您好,登錄后才能下訂單哦!
Winphone 沒有直接刪除文件夾的接口(因?yàn)槲募A不為空是刪除不了的),所以要自己實(shí)現(xiàn) public static void DeleteDirectoryRecursively(this IsolatedStorageFile storageFile, String dirName){ String pattern = dirName + @"\*"; String[] files = storageFile.GetFileNames(pattern); foreach (var fName in files) { storageFile.DeleteFile(Path.Combine(dirName, fName)); } String[] dirs = storageFile.GetDirectoryNames(pattern); foreach (var dName in dirs) { DeleteDirectoryRecursively(storageFile, Path.Combine(dirName, dName)); } storageFile.DeleteDirectory(dirName);}
http://stackoverflow.com/questions/18422331/easy-way-to-recursively-delete-directories-in-isolatedstorage-on-wp7-8
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。