当前位置: 代码迷 >> Windows Mobile >> 创建IsolatedStorageFileStream时发生错误错误
  详细解决方案

创建IsolatedStorageFileStream时发生错误错误

热度:53   发布时间:2016-04-25 07:23:03.0
创建IsolatedStorageFileStream时发生异常异常
本帖最后由 kiygaven 于 2013-07-07 11:53:33 编辑
我使用Socket从pc端向wp发送文件
在wp端创建IsolatedStorageFileStream对象时发生错误
异常信息如下
[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

发生异常的位置是一个自定义事件,红色语句
        private void ssReceiver_ReceiveFileCompleted(object sender, SocketOperatorEventArgs e)
        {
            using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
            {
                ...
                using (IsolatedStorageFileStream isfs =isf.CreateFile(Path.Combine("Folder", ssReceiver.SocketFile.FileName)))
                {
                    ...
                }
            }
        }

事件的调用是在SocketAsyncEventArgs的Completed事件中
该自定义事件如下
        public delegate void ReceiveFileCompletedEventHandler(object sender, SocketOperatorEventArgs e);
        public event ReceiveFileCompletedEventHandler ReceiveFileCompleted;

        protected virtual void OnReceiveFileCompleted(SocketOperatorEventArgs e)
        {
            if (this.ReceiveFileCompleted != null)
                this.ReceiveFileCompleted(this, e);
        }


        void ReceivesCompleted(object sender, SocketAsyncEventArgs e)
        {