IsolatedStorageFile.FileExists(string path)
有效,但StreamReader(string samePath)
没有?我已经验证了两条路径是相等的。我不知道为什么 StreamReader 会爆炸
List<ProjectObj> ret = new List<ProjectObj>();
IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
if (!file.DirectoryExists("/projects/")) //trying to validate the dir exists
return ret;
string[] fileNames = file.GetFileNames("/projects/");
foreach (string filename in fileNames)
{
if (!file.FileExists("/projects/" + filename)) //validate just one more time..
continue;
ProjectObj tempProj = new ProjectObj();
//Even with the validation it still breaks right here with the bellow error
StreamReader reader = new StreamReader("/projects/"+filename);
mscorlib.ni.dll 中出现“System.IO.DirectoryNotFoundException”类型的异常,但未在用户代码中处理
消息:找不到路径“C:\projects\Title_939931883.txt”的一部分。