Jimmu John Jimmu John - 1 year ago 133
Vb.net Question

Get date creation or date modified of a file?

I want to get creation date, last modify date other details relating to files, and adding them to a datagridview. Currently I am getting the file information by using

Here's what i got so far:

Dim paths() As String = IO.Directory.GetFiles("mypath")

For Each sFile As String In paths
Dim fileNameOnly As String = Path.GetFileNameWithoutExtension(sFile)

Answer Source

This is how I would grab both the created date, and the last write time.

For each sfile as datetime.tostring in paths
     Dim fileCreatedDate As DateTime = File.GetCreationTime(paths)
     Dim fileLastWrite as DateTime = File.GetLastWriteTime(path)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download