我试着做这样的事:
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.FileExists(fileName))
{
store.DeleteFile(fileName);
}
}但是System.IO.IsolatedStorage.IsolatedStorageException:无法删除文件。
怎么啦?
发布于 2014-06-20 07:33:03
所以我通过在打开文件时使用FileMode.Truncate来解决我的问题。
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var fileStream = store.OpenFile(fileName, FileMode.Truncate, FileAccess.ReadWrite, FileShare.ReadWrite))
{
//Do stuff
}
}https://stackoverflow.com/questions/24287748
复制相似问题