// 將某個文件夾下的所有文件移動到目標(biāo)文件當(dāng)中
? ? public void MoveFileToDestination(string sourthPath,string destinationPath)
? ? {
? ? ? ? // 獲取源文件夾
? ? ? ? DirectoryInfo sourceFile = new DirectoryInfo(sourthPath);
? ? ? ? // 獲取源文件下的所有文件信息
? ? ? ? FileInfo[] fileArray = sourceFile.GetFiles();
? ? ? ? // 遍歷每一個文件,將其移動到沙盒
? ? ? ? foreach (FileInfo temp in fileArray)
? ? ? ? {
? ? ? ? ? ? // 根據(jù)文件名創(chuàng)建目標(biāo)路徑
? ? ? ? ? ? string path = Path.Combine(destinationPath, temp.Name);
? ? ? ? ? ? // 移動
? ? ? ? ? ? temp.MoveTo(path);
? ? ? ? }
? ? }