New DirectoryInfo : DirectoryInfo « System.IO « VB.Net by API






New DirectoryInfo

  


Imports System.IO

Module Module1

    Sub Main()
        Dim Root As New DirectoryInfo("C:\")

        Dim Files As FileInfo() = Root.GetFiles("*.*")
        Dim Dirs As DirectoryInfo() = Root.GetDirectories("*.*")

        Console.WriteLine("Root Files")
        Dim Filename As FileInfo

        For Each Filename In Files
            Try
                Console.Write(Filename.FullName)
                Console.Write(" Size: {0} bytes", Filename.Length)
                Console.WriteLine(" Last use: {0}", Filename.LastAccessTime)
            Catch E As Exception
                Console.WriteLine("Error accessing File")
            End Try
        Next
    End Sub

End Module

   
    
  








Related examples in the same category

1.DirectoryInfo.CreationTime
2.DirectoryInfo.FullName
3.DirectoryInfo.GetDirectories()
4.DirectoryInfo.GetDirectories(String filter)
5.DirectoryInfo.GetFiles
6.DirectoryInfo.LastAccessTime
7.DirectoryInfo.LastWriteTime
8.DirectoryInfo.Root