2013-12-20 73 views
0

我試圖讀取包含這是我從mic.Now拍攝時我使用下面的查詢,我可以看到保存在我的IsolatedStorage文件列表查詢應用商店的音頻數據文件。IsolatedStorageException:[IsolatedStorage_Operation_ISFS]例外,在Windows手機應用程序

查詢:查詢

var f = userStore.GetFileNames(); 
foreach (var df in f) { 
    System.Diagnostics.Debug.WriteLine(df); 
} 

結果:

Audio.sdf 
Audio1.wav 
Audio2.wav 

但是當我嘗試讀取文件 「Audio1.wav」 使用此查詢:

FileStream = new IsolatedStorageFileStream(FileName, FileMode.Open, userStore); 

我得到以下錯誤:

An exception of type 'System.IO.IOException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary 
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll 
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary 
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) 
    at AudioRecorder.MainPage.start_player() 

任何幫助嗎?

回答

0

試試這個,它可能幫你。授予FileAccess權限。 當我們想讀取文件時,我們使用FileAccess.Read!您可以從http://msdn.microsoft.com/en-us/library/4z36sx0f%28v=VS.90%29.aspx

using (IsolatedStorageFileStream fileStream = userStore.OpenFile(FilePath, FileMode.Open, FileAccess.Read)) 
{ 
    //your code      
} 
+0

找到所有FileAccess可能的列表。 –

+0

@RajatSaxena這個鏈接播放.wav文件http://developer.nokia.com/Community/Wiki/How_to_embed_and_play_a_.wav_file_in_Windows_Phone_7_app或使用的MediaElement打開和播放音頻,視頻在WP應用 – Jaihind

相關問題