Get FileSystemInfos : FileSystemInfo « Stream File « VB.Net Tutorial






Imports System.IO

public class Test
   public Shared Sub Main
        Dim strPath As String = "C:\Program Files"
        Dim objDI As New DirectoryInfo(strPath)
        Dim aryItemsInfo() As FileSystemInfo
        Dim objItem As FileSystemInfo

        aryItemsInfo = objDI.GetFileSystemInfos()
        For Each objItem In aryItemsInfo
            If objItem.Attributes And FileAttributes.Directory Then
                Console.WriteLine("FOLDER ")
            Else
                Console.WriteLine("FILE ")
            End If
            Console.WriteLine(objItem.Name)
        Next

   End Sub
End class
FOLDER
Adobe
FOLDER
AMD
FOLDER
ATI Technologies
FOLDER








13.8.FileSystemInfo
13.8.1.Get FileSystemInfos