AstroGuy
asked on
Creating a file in isolated storage
The following example from .NET Framework 2.on page135 gives 3 errors.
What have I done wrongZ?
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();
}
}
ASKER
Yes I used a console application. I received the following compile errors as the attached screenshot shows.
x-LabErrors-p154.JPG
x-LabErrors-p154.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very good eye mysteriousguy. Thanks. BTW this code was originally cut and pasted from the text.
I ran this code in Visual Studio 2008 with framework 2.0 without any errors.