Isolated Storage File Stream form input and output : IsolatedStorageFile « File Stream « C# / C Sharp






Isolated Storage File Stream form input and output

    

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

 class Utils
{

    public static Stream GetSettingsReadStream()
    {
        IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForDomain();
        IsolatedStorageFileStream stream = new IsolatedStorageFileStream("settings.bin", FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite, file);
        return stream;
    }

    public static Stream GetSettingsWriteStream()
    {
        IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForDomain();
        IsolatedStorageFileStream stream = new IsolatedStorageFileStream("settings.bin", FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read, file);
        return stream;
    }
}

   
    
    
    
  








Related examples in the same category

1.GetFileNames, CreateDirectory, GetUserStoreForAssembly
2.CurrentSize and Scope
3.IsolatedStorageFile represents an isolated storage area containing files and directories.