|
-
October 21st, 2018, 05:09 PM
#1
GetLastWriteTime
I have a line of code in an onChanged event for a FileSystemWatcher, and have not gotten the result that I want. Here's the code:
Code:
str = "SELECT Base, Target FROM Backup WHERE Base = " & "'" & getDir & "'" & "OR Target = " & "'" & getDir & "'"
cmd.Connection = myConn
cmd.CommandText = str
myConn.Open()
Dim lstReader As OleDbDataReader = cmd.ExecuteReader()
lstReader.Read()
baseDir = lstReader.Item(0).ToString()
targetDir = lstReader.Item(1).ToString()
baseTime = IO.File.GetLastWriteTime(lstReader.Item(0).ToString() + "\" + e.Name)
targetTime = IO.File.GetLastWriteTime(lstReader.Item(1).ToString() + "\" + e.Name)
MessageBox.Show(baseTime.ToString() + "--" + targetTime.ToString())
I'm finding that the GetLastWriteTime that is returned to me is not the lastest write time; for instance, I open a graphics file, change it, and then save it, but the last write time that is returned to me from the onChanged event is not the write time from my last save, but earlier. Does anyone know why this may be? I didn't post the whole sub, but if anyone needs me to I will.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|