本文整理匯總了VB.NET中System.IO.IsolatedStorage.IsolatedStorageFile.GetFileNames方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET IsolatedStorageFile.GetFileNames方法的具體用法?VB.NET IsolatedStorageFile.GetFileNames怎麽用?VB.NET IsolatedStorageFile.GetFileNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.IsolatedStorage.IsolatedStorageFile
的用法示例。
在下文中一共展示了IsolatedStorageFile.GetFileNames方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: String
Dim dirNames As String() = isoFile.GetDirectoryNames("*")
Dim fileNames As String() = isoFile.GetFileNames("*")
Dim name As String
' List directories currently in this Isolated Storage.
If dirNames.Length > 0 Then
For Each name In dirNames
Console.WriteLine("Directory Name: " & name)
Next name
End If
' List the files currently in this Isolated Storage.
' The list represents all users who have personal preferences stored for this application.
If fileNames.Length > 0 Then
For Each name In fileNames
Console.WriteLine("File Name: " & name)
Next name
End If
示例2: Tester
' 導入命名空間
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