string[] sSrcFSet = System.IO.Directory.GetFiles(sSrcPath);
foreach (string sSrcF in sSrcFSet)
{
string sF = sSrcF;
sF = sF.Replace(sSrcPath,sDescPath);
System.IO.File.Copy(sSrcF,sF,true);
}
}
catch (ArgumentNullException)
{
System.Console.WriteLine("Path is a null reference.");
}
catch (System.Security.SecurityException)
{
System.Console.WriteLine("The caller does not have the required permission.");
}
catch (ArgumentException)
{
System.Console.WriteLine("Path is an empty string, contains only white spaces, or contains invalid characters.");
}
catch (System.IO.DirectoryNotFoundException)
{
System.Console.WriteLine("The path encapsulated in the Directory object does not exist.");
}
}