Jimmu John Jimmu John - 8 months ago 56
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)


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)