Get last modified file date in VB6

How can you get the latest modified file date using VB6?

+6
vb6
source share
4 answers

There is a built-in VB6 function for this - there is no need for FSO (although FSO is great for more complex file operations)

From http://msdn.microsoft.com/en-us/library/aa262740%28VS.60%29.aspx

Dim MyStamp As Date MyStamp = FileDateTime("C:\TESTFILE.txt") 
+20
source share

Add a link to the Microsoft Scripting Runtime executable (Project-> References ...) and use the following code:

 Dim fso As New FileSystemObject Dim fil As File Set fil = fso.GetFile("C:\foo.txt") Debug.Print fil.DateLastModified 
+2
source share

You can use FileSystemObject example here

You can also check the MSDN documentation , sample scripts, but they should be easily translated to VB6.

0
source share

I would recommend using the windows api call: http://www.ex-designz.net/apidetail.asp?api_id=128

Then you can get the creation date or the last modified date.

0
source share

All Articles