1. 程式人生 > >Unity中關於txt文件的一些操作

Unity中關於txt文件的一些操作

if(Directory.Exists(yourPath))
{
//獲取指定路徑下所有資料夾string[] folderPaths = Directory.GetDirectories(yourPath);
foreach(string folderPath in folderPaths)
           Directory.Delete(folderPath, true);
//獲取指定路徑下所有檔案string[] filePaths = Directory.GetFiles(yourPath);
foreach(string filePath in filePaths)
           File.Delete(filePath);
}