Imports System.IO
Module Module1
Sub Main()
For Each entry As String In Directory.GetDirectories("C:\")
DisplayFileSystemInfoAttributes(New DirectoryInfo(entry))
Next
For Each entry As String In Directory.GetFiles("C:\")
DisplayFileSystemInfoAttributes(New FileInfo(entry))
Next
End Sub
Sub DisplayFileSystemInfoAttributes(ByVal fsi As IO.FileSystemInfo)
Dim entryType As String = "File"
If (fsi.Attributes And FileAttributes.Directory) = FileAttributes.Directory Then
entryType = "Directory"
End If
Console.WriteLine("{0} entry {1} was created on {2:D}",entryType, fsi.FullName, fsi.CreationTime)
End Sub
End Module