Winphone 没有直接删除文件夹的接口(因为文件夹不为空是删除不了的),所以要自己实现 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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。