Get file Creation Time, Last Access Time and Modified Time : FileInfo « Stream File « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main
    
        Dim fileDetail As IO.FileInfo


        fileDetail = My.Computer.FileSystem.GetFileInfo("test.txt")

        Console.WriteLine("Created: " & fileDetail.CreationTime)
        Console.WriteLine("Accessed: " & fileDetail.LastAccessTime)
        Console.WriteLine("Modified: " & fileDetail.LastWriteTime)
    End Sub

End Class
Created: 11/05/2007 9:20:09 PM
Accessed: 11/05/2007 9:26:39 PM
Modified: 11/05/2007 9:26:04 PM








13.4.FileInfo
13.4.1.My.Computer.FileSystem.GetFileInfo(''File Name'')
13.4.2.FileInfo.IsReadOnly, FileAttributes.Hidden
13.4.3.Set file attributes: Hidden, ReadOnly
13.4.4.Get File Attributes as a string
13.4.5.Get file Creation Time, Last Access Time and Modified Time
13.4.6.Get file size
13.4.7.Get file extension name