Solved

Creating a file in isolated storage

Posted on 2009-07-08
4
174 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

810 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