Note that there are some explanatory texts on larger screens.

plurals
  1. POIsolatedStorageFile giving exception
    primarykey
    data
    text
    <p>In windows phone 7, I am trying to write to a file and then trying to read from a file, but while reading it is giving the exception below.</p> <pre><code>public static void writeToFile(String videoUrl) { IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); store.CreateDirectory("MyFolder"); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("MyFolder\\data.txt", FileMode.Append, FileAccess.Write, store); StreamWriter writer = new StreamWriter(stream); writer.WriteLine(videoUrl); } public static void readFromFile() { try { IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("MyFolder\\data.txt", FileMode.Open, store); StreamReader reader = new StreamReader(stream); string line; while ((line = reader.ReadLine()) != null) { Debug.WriteLine("kkkkkk-----------------" + line); // Write to console. } } catch (Exception ex) { Debug.WriteLine("ESPNGoalsUtil::readFromFile : " + ex.ToString()); } } </code></pre> <p>Exception:</p> <pre><code>System.IO.IsolatedStorage.IsolatedStorageException: Operation not permitted on IsolatedStorageFileStream. 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 ESPNGoals.Utility.ESPNGoalsUtil.readFromFile() </code></pre> <p>I am writing the file and then reading the file in the same method and not closing the emulator.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload