IsolatedStorageFile Class Represents an isolated storage area containing files and directories. : IsolatedStorageFile « File Directory « VB.Net






IsolatedStorageFile Class Represents an isolated storage area containing files and directories.

 

Imports System
Imports System.IO
Imports System.IO.IsolatedStorage

Public Class CreatingFilesDirectories
    Public Shared Sub Main()
        Dim isoStore As IsolatedStorageFile
        isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or _
            IsolatedStorageScope.Assembly Or IsolatedStorageScope.Domain, Nothing, Nothing)

        isoStore.CreateDirectory("TopLevelDirectory")
        isoStore.CreateDirectory("TopLevelDirectory/SecondLevel")

        isoStore.CreateDirectory("AnotherTopLevelDirectory/InsideDirectory")

        Dim isoStream1 As New IsolatedStorageFileStream("InTheRoot.txt", FileMode.Create, isoStore)
        Console.WriteLine("Created a new file in the root.")
        isoStream1.Close()

        Dim isoStream2 As New IsolatedStorageFileStream("AnotherTopLevelDirectory/InsideDirectory/HereIAm.txt", _
            FileMode.Create, isoStore)
        isoStream2.Close()
    End Sub
End Class

   
  








Related examples in the same category