我正在尝试读取未在应用程序中创建的文件。
这是我尝试过的示例:
string FileName = "stops.txt";
string FolderName = "data";
string FilePath = System.IO.Path.Combine(FolderName, FileName);
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile(FilePath, FileMode.Open, FileAccess.Read);
using (StreamReader reader = new StreamReader(fileStream))
{
MessageBox.Show(reader.ReadLine());
}
我抛出一个“isolatedstorageexception”: 链接到异常
System.IO.IsolatedStorage.IsolatedStorageException: [IsolatedStorage_Operation_ISFS]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50829.0&File=mscorlib.dll&Key=IsolatedStorage_Operation_ISFS
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(String path, FileMode mode, FileAccess access)
at HorairesCTS.MainPage.test()
at HorairesCTS.MainPage..ctor()
有人可以帮我阅读这个文件吗?
谢谢 !