Solved

Creating a file in isolated storage

Posted on 2009-07-08
4
173 Views
Last Modified: 2013-12-17
The following example from .NET Framework 2.on page135 gives 3 errors.
What have I done wrongZ?
using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.IO.IsolatedStorage;
 

class Program

{

  static void Main(string[] args)

  {

    // Create a Store for the current user

    IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly();
 

    IsolatedStorageFileStream userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Create, userStore);

    StreamWriter userWriter = new StreamWriter(userStream);

    userWriter.WriteLine("User Prefs");

    userWriter.Close();
 

    Console.Read();

  }
 

}

Open in new window

0
Comment
Question by:AstroGuy
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:mysteriousguy
ID: 24804334
Which errors do you get? Did you create a console application to implement the example?
I ran this code in Visual Studio 2008 with framework 2.0 without any errors.
0
 

Author Comment

by:AstroGuy
ID: 24805080
Yes I used a console application.  I received the following compile errors as the attached screenshot shows.
x-LabErrors-p154.JPG
0
 
LVL 4

Accepted Solution

by:
mysteriousguy earned 500 total points
ID: 24805406
You made a mistake in spelling of IsolatedStorageFileStream.
0
 

Author Closing Comment

by:AstroGuy
ID: 31601118
Very good eye mysteriousguy.  Thanks. BTW this code was originally cut and pasted from the text.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now