I have a number of files in a folder, and I need to get the last modified date. So I used
FDate = IO.File.GetLastWriteTime(FName)
It works fine
The query mentioned below will get the correct LastModifiedDate
for all of the files contained in a folder.
Dim strFilepath = "" 'Specify path details
Dim directory As New System.IO.DirectoryInfo(strFilepath)
Dim File As System.IO.FileInfo() = directory.GetFiles()
Dim File1 As System.IO.FileInfo
For Each File1 In File
Dim strLastModified As String
strLastModified = System.IO.File.GetLastWriteTime(strFilepath & "\" & File1.Name).ToShortDateString()
Next