how would i coppy only specific things out of a directory. say *.mp3. I am able to copy the whold directory but i only want specific endings.
this is part of the copy code
try
{
Directory.CreateDirectory(targerDirectoryName);
string[] files = Directory.GetFiles(sourceDirectoryName);
foreach (string fileName in files)
File.Copy(fileName, targerDirectoryName + Path.DirectorySeparatorChar + Path.GetFileName(fileName));
string[] directories = Directory.GetDirectories(sourceDirectoryName);
foreach (string directory in directories)
CopyDirectory(directory, targerDirectoryName + Path.DirectorySeparatorChar + Path.GetFileName(directory));
}
catch
{
//
}
if you no how i can specify wha i want to copy that be great.