Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Silverlight - Using Isolated Storage

12 minutes, 33 seconds


Right click “Save as…”

  • WMV (WMV Video)
A Silverlight application can securely store data isolated per-application, per-user on the local machine - here we look at how that works.

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • Simply the best.

  • Great Post.


    What if i have a .asx file in IsoStore and how do i return it as a file to a silverlight control like media element.

  • touristtourist

    You can also use the XmlSerializer (from System.Xml.Serialization) to save ur data in a XML file:
    // Save method:
                using (var file = IsolatedStorageFile.GetUserStoreForApplication())            {                var xs = new XmlSerializer(typeof(List<Rect>));                using (IsolatedStorageFileStream stream = file.CreateFile("rects.xml"))                {                    xs.Serialize(stream, list);                    stream.Close();                }            }
    And reading is easy to:
    // Load method:
                using (var file = IsolatedStorageFile.GetUserStoreForApplication())            {                // NOTE: you should check if file exist..                var xs = new XmlSerializer(typeof(List<Rect>));
                    using (IsolatedStorageFileStream stream = file.OpenFile(FILENAME, FileMode.Open))                {                    list = (List<Rect>) xs.Deserialize(stream);                    stream.Close();                }

  • touristtourist

    oh boy.. thats not readable. it didn't save the text formatting.. sorry about that.
    click the link below for a more readable version of the code:

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.