在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
/// <summary> /// 文件夹拷贝 /// </summary> /// <param name="sourDir"></param> /// <param name="projectID"></param> /// <param name="programID"></param> /// <returns></returns> private static bool CopyTo(DirectoryInfo sourDi,DirectoryInfo destDi) { FileInfo[] arFile= sourDi.GetFiles(); for (int i = 0; i <= arFile.Length - 1; i++) { arFile[i].CopyTo(destDi.FullName + "\\" + arFile[i].Name,true); } DirectoryInfo[] arDi = sourDi.GetDirectories(); for (int i = 0; i <= arDi.Length - 1; i++) { if (!Directory.Exists(destDi + "\\" + arDi[i].Name)) Directory.CreateDirectory(destDi + "\\" + arDi[i].Name); DirectoryInfo destSub =new DirectoryInfo(destDi + "\\" + arDi[i].Name); CopyTo(arDi[i], destSub); } return true; }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论