응용 프로그램에서 생성되지 않은 파일을 읽으려고합니다. Windows phone 7 응용 프로그램에서 IsolatedStorageException이 발생했습니다.
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"을 던져 :
link to exception
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()
누군가가 나에게이 파일을 읽을 수 있도록 할 수
여기에 내가 시도 샘플입니다?
감사합니다.
"응용 프로그램에서 생성되지 않았다"고 말할 때 - 파일을 만든 이유는 무엇입니까? 응용 프로그램에서 만든 것이 아니라면 응용 프로그램의 사용자 저장소에있는 이유는 무엇입니까? –
격리 된 저장소 기능으로 생성되지 않은 프로젝트에서 복사/붙여 넣기 한 파일 –
격리 된 저장소에 있지 않은 것으로 의심됩니다. 적어도 격리 된 저장소의 사용자 부분에는 없습니다. 프로젝트에있는 경우 리소스 URL로 액세스하거나 어셈블리에 포함 할 수 있습니다. –