IsolatedStorageFile represents an isolated storage area containing files and directories. : IsolatedStorageFile « File Stream « C# / C Sharp






IsolatedStorageFile represents an isolated storage area containing files and directories.

  

using System;
using System.IO;
using System.IO.IsolatedStorage;

public class MainClass
{
    public static void Main()
    {
        IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, null, null);
        isoStore.CreateDirectory("TopLevelDirectory");
        isoStore.CreateDirectory("TopLevelDirectory/SecondLevel");

        isoStore.CreateDirectory("AnotherTopLevelDirectory/InsideDirectory");

        IsolatedStorageFileStream isoStream1 = new IsolatedStorageFileStream("InTheRoot.txt", FileMode.Create, isoStore);
        isoStream1.Close();

        IsolatedStorageFileStream isoStream2 = new IsolatedStorageFileStream("HereIAm.txt", FileMode.Create, isoStore);
        isoStream2.Close();

    }
}

   
    
  








Related examples in the same category

1.GetFileNames, CreateDirectory, GetUserStoreForAssembly
2.CurrentSize and Scope
3.Isolated Storage File Stream form input and output