隔离存储删除文件会创建异常 [英] Isolated storage delete file creates exception

查看:91
本文介绍了隔离存储删除文件会创建异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试删除隔离存储中的目录时出现异常。


访问IsolatedStorage时出错


IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();


string directory = SaveListPicker.SelectedItem.ToString();


 


 试试

{

if(storageFile.DirectoryExists(directory))

{

var imageslist = storageFile.GetFileNames(目录+" \\ *。*");

foreach(图片列表中的var项目)

{

  storageFile.DeleteFile(目录+" \\" + item);

}


}

                

}

catch(例外e)

  {

string exceptionresult = e.Message;

}

解决方案

所以除了异常以外,你给了我们一切。 :\

I am getting an exception when trying to delete directory in the isolated storage.

An error occurred while accessing IsolatedStorage

IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();

string directory = SaveListPicker.SelectedItem.ToString();

 

 try
{
if (storageFile.DirectoryExists(directory))
{
var imageslist = storageFile.GetFileNames(directory+"\\*.*") ;
foreach (var item in imageslist)
{
 storageFile.DeleteFile(directory + "\\" + item);
}

}
                
}
catch (Exception e)
 {
string exceptionresult = e.Message;
}

解决方案

So you gave us everything except what the exception was. :\


这篇关于隔离存储删除文件会创建异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆