【发布时间】:2014-03-20 14:48:33
【问题描述】:
我正在尝试从隔离存储中删除文件。但它向我返回错误消息。我不知道我在哪里做错了。
public void Delete(string folder, string fileName)
{
try
{
string path = folder + "\\" + fileName + ".txt";
string delPath = folder + "/" + fileName + ".txt";
MessageBox.Show(delPath);
if (myIsolatedStorage.DirectoryExists(folder))
{
if (myIsolatedStorage.FileExists(delPath))
{
myIsolatedStorage.DeleteFile(delPath);
MessageBox.Show("File is Deleted..!!");
}
else
MessageBox.Show("There is no file is exists");
}
else
{
MessageBox.Show("There is no Folder is exists");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
请让我知道我在哪里做错了。 提前谢谢..
错误信息:-
【问题讨论】:
-
尝试在文件夹前添加
/ -
你得到什么错误信息或异常
-
大家好!!在这里我附上了一个截图..请参考这个..
-
嗨@Ku6opr ..尝试了你的建议..直到现在发生同样的错误..
-
在哪一行代码中出现错误?我成功删除了您的代码和文件。
标签: c# windows-phone-7 isolatedstorage