PDA

Click to See Complete Forum and Search --> : Problems getting File Times in Windows 2000


VB6Coder
Aug 24th, 2001, 05:35 AM
I'm trying to get the Created, Modified and Accessed times of a file in Windows 2000. I found an example on the www.vbapi.com website (http://www.vbapi.com/ref/g/getfiletime.html) showing me how to get the File Time using the GetFileTime API.

The problem is I keep getting -1 returned when I use the CreateFile API in Windows 2000, but it works fine in Windows 95.

I've tried using the OpenFile API instead of the CreateFile API. The problem is it makes the GetFileTime API return a more recent date, than the date displayed in the File Properties dialog.


Help
:confused:


Thanks in advance.
:)

JoshT
Aug 24th, 2001, 06:14 AM
I used the FindFirstFile function on Win2000 to get the FILETIME and it seems to work ok.

VB6Coder
Aug 24th, 2001, 06:32 AM
Cheers Josh, I'll have a play with the FindFirstFile API.
:)