当前位置: 代码迷 >> Silverlight >> 不允许对 IsolatedStorageFileStream 执行操作有关问题
  详细解决方案

不允许对 IsolatedStorageFileStream 执行操作有关问题

热度:2765   发布时间:2013-02-26 00:00:00.0
不允许对 IsolatedStorageFileStream 执行操作问题
  
这样设置的话,代码: IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
            Stream stream = new IsolatedStorageFileStream("MyText.txt", System.IO.FileMode.Open, System.IO.FileAccess.Read, isf);
            System.IO.TextReader reader = new System.IO.StreamReader(stream);
            string sLine = reader.ReadLine();
            reader.Close(); // Close the reader
            stream.Close(); // Close the stream
红色代码会提示不允许对 IsolatedStorageFileStream 执行操作问题,出现错误。

假如改为:

这样子就没有一点错误,这是为什么呢,没有权限读取txt
------解决方案--------------------------------------------------------
log4 for  silverlight