VB.Net by API/System.IO.IsolatedStorage/IsolatedStorageFileStream

Материал из VB Эксперт
Версия от 12:50, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

IsolatedStorageFileStream.CreateDirectory

  
Imports System.IO.IsolatedStorage
Public Class Tester
    Public Shared Sub Main
        Dim myIsoStore As IsolatedStorageFile
        Try
            myIsoStore.CreateDirectory("oldDir")
            Dim myIsoStroeStream As New IsolatedStorageFileStream("oldDir/oldFile", IO.FileMode.Create.Create, myIsoStore)
            myIsoStroeStream.Close()
        
        
           myIsoStore.DeleteDirectory("oldDir")
           myIsoStore.DeleteFile("oldeDir/oldFile")
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try

    End Sub
End Class


IsolatedStorageFileStream.DeleteDirectory

  

Imports System.IO.IsolatedStorage
Public Class Tester
    Public Shared Sub Main
        Dim myIsoStore As IsolatedStorageFile
        Try
            myIsoStore.CreateDirectory("oldDir")
            Dim myIsoStroeStream As New IsolatedStorageFileStream("oldDir/oldFile", IO.FileMode.Create.Create, myIsoStore)
            myIsoStroeStream.Close()
        
        
           myIsoStore.DeleteDirectory("oldDir")
           myIsoStore.DeleteFile("oldeDir/oldFile")
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try

    End Sub
End Class


IsolatedStorageFileStream.DeleteFile

  
Imports System.IO.IsolatedStorage
Public Class Tester
    Public Shared Sub Main
        Dim myIsoStore As IsolatedStorageFile
        Try
            myIsoStore.CreateDirectory("oldDir")
            Dim myIsoStroeStream As New IsolatedStorageFileStream("oldDir/oldFile", IO.FileMode.Create.Create, myIsoStore)
            myIsoStroeStream.Close()
        
        
           myIsoStore.DeleteDirectory("oldDir")
           myIsoStore.DeleteFile("oldeDir/oldFile")
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try

    End Sub
End Class


New IsolatedStorageFileStream

  
Imports System.IO.IsolatedStorage
        
Public Class Tester
    Public Shared Sub Main
        Dim myIsoStore As IsolatedStorageFile
        Try
            myIsoStore.CreateDirectory("newDir")
            Dim myIsoStroeStream As New IsolatedStorageFileStream("test.txt", IO.FileMode.Create.Create, myIsoStore)
            myIsoStroeStream.Close()
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try
    End Sub
End Class