File Dates

  • Thread starter Thread starter Wayne Taylor
  • Start date Start date
W

Wayne Taylor

Hi All

I want to read what a partially file date is. So I can log it and look back
in the log and see if the auto update from another device has missed at any
point.

I have used FileSystemWatcher componets to detect the file has changed, I
just want to grab the time and date....is that to much to ask.

Does any one how to do this?

Cheers

Wayne Taylor
www.kryptos.co.uk/blog
 
Hi all

Figured it out, I did the following

Private Sub fsw_All(ByVal sender As Object, ByVal e As FileSystemEventArgs)
Handles fsw.Changed, fsw.Created, fsw.Deleted
Dim changetype As String =
[Enum].GetName(GetType(WatcherChangeTypes), e.ChangeType)
Dim RecordDate As FileInfo = New FileInfo(e.FullPath)

Debug.Write(RecordDate.LastWriteTime())
Debug.Write("file event: " & e.FullPath & " (" & changetype &
")")

End Sub

Cheers

Wayne Taylor

www.kryptos.co.uk/blog
 
Wayne Taylor said:
Figured it out, I did the following

Another way is quit simple...

' Check for Updated TimberLine Data File
' and Copy the Most Current Data File
' ======================================
Dim TimberLineFilName, AppFilName As String
TimberLineFilName = mdbDataPath & "TimberlineData.mdb"
AppFilName = appPath & "\TimberlineData.mdb"

If File.Exists(AppFilName) = True Then
Dim fd1 As String = File.GetLastWriteTime(TimberLineFilName)
Dim fd2 As String = File.GetLastWriteTime(AppFilName)
If fd1 <> fd2 Then FileCopy(TimberLineFilName, AppFilName)
Else : FileCopy(TimberLineFilName, AppFilName)
End If

Regards,

Bruce
 
Back
Top