小编Amy*_* Li的帖子

获取IsolatedStorageException:IsolatedStorageFileStream上不允许操作

我在以下代码中遇到上述异常和错误,这意味着从隔离存储中播放选定的mp3文件:

using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{            
     using (var isfs = isf.OpenFile(selected.Path, FileMode.Open))
     {                        
          this.media.SetSource(isfs);              
          isfs.Close();                        
     }                    
     isf.Dispose();
}
Run Code Online (Sandbox Code Playgroud)

错误是如此模糊,以至于我不确定会出现什么问题......我可以检查的任何想法或至少是这个错误的常见来源?

编辑:异常被抛出: using(var isfs = isf.OpenFile(...))

编辑2:堆栈跟踪......

at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, IsolatedStorageFile isf)
at Ringify.Phone.PivotContent.RingtoneCollectionPage.MediaIconSelected(Object sender, GestureEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, …
Run Code Online (Sandbox Code Playgroud)

c# windows-phone-7

9
推荐指数
1
解决办法
5234
查看次数

标签 统计

c# ×1

windows-phone-7 ×1