---------------------- ASP.Net+Unity开发、.Net培训、期待与您交流! ----------------------
static bool CopyDir(string fromdic, string todic)
{
bool flag = false;
if (!Directory.Exists(todic))
{
Directory.CreateDirectory(todic);
}
//复制所有文件
foreach (string filename in Directory.GetFiles(fromdic))
{
File.Copy(filename, todic + "\\" + Path.GetFileName(filename), true);
}
//复制所有子文件夹(递归)
foreach (string subdic in Directory.GetDirectories(fromdic))
{
CopyDir(subdic, todic + "\\" + Path.GetFileName(todic));
}
flag = true;
return flag;
}
---------------------- ASP.Net+Unity开发 、 .Net培训 、期待与您交流! ----------------------