VB.Net by API/System.IO.IsolatedStorage/IsolatedStorageFile — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 12:50, 26 мая 2010

IsolatedStorageFile.CreateDirectory

  
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


IsolatedStorageFile.GetDirectoryNames

  
Imports System.IO.IsolatedStorage
Public Class Tester
    Public Shared Sub Main
        Dim strFile As String
        Dim strDir As String
        Dim myIsoStore As IsolatedStorageFile
        Try
            For Each strDir In myIsoStore.GetDirectoryNames("*")
                Console.WriteLine(strDir)
                For Each strFile In myIsoStore.GetFileNames(strDir + "/*.*")
                    Console.WriteLine(strFile)
                Next
            Next
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try
    End Sub
End Class


IsolatedStorageFile.GetFileNames

  
Imports System.IO.IsolatedStorage
Public Class Tester
    Public Shared Sub Main
        Dim strFile As String
        Dim strDir As String
        Dim myIsoStore As IsolatedStorageFile
        Try
            For Each strDir In myIsoStore.GetDirectoryNames("*")
                Console.WriteLine(strDir)
                For Each strFile In myIsoStore.GetFileNames(strDir + "/*.*")
                    Console.WriteLine(strFile)
                Next
            Next
        Catch ex As IsolatedStorageException
            Console.WriteLine(ex.Message)
        End Try
    End Sub
End Class