Solved

Creating a file in isolated storage

Posted on 2009-07-08
4
172 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
Comment Utility
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
Comment Utility
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
Comment Utility
You made a mistake in spelling of IsolatedStorageFileStream.
0
 

Author Closing Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

7 Experts available now in Live!

Get 1:1 Help Now