Write To Isolated Storage in CSharp

Description

The following code shows how to write To Isolated Storage.

Example


using System;//from   ww w  .jav  a  2 s.c o m
using System.Collections.Generic;
using System.IO;
using System.IO.IsolatedStorage;
using System.Text;


    public class Tester
    {
        public static void Main()
        {
            IsolatedStorageFileStream configFile =new IsolatedStorageFileStream("Tester.cfg", FileMode.Create);
            StreamWriter writer = new StreamWriter(configFile);
            String output;
            System.DateTime currentTime = System.DateTime.Now;
            output = "Last access: " + currentTime.ToString();
            writer.WriteLine(output);
            output = "Last position = 27,35";
            writer.WriteLine(output);
            writer.Close();
            configFile.Close();
        }
    }




















Home »
  C# Tutorial »
    IO »




File Attribute
File Security
Directory Attribute
Directory Recursive
Binary File
Text Field
Buffered IO
Create Copy Delete Move
CSV
Drive
File System Watcher
Isolated Storage
MemoryStream
Serialize
Zip