How to get a DateTime stamp of a text file using VB 6

How do you get the DateTime stamp of a text file using VB 6.0? By DateTime, I mean the date and time when the text file was created or modified. Sample code will be appreciated. Thank.

+2
source share
4 answers

For the created / last change, you can simply:

dateVar = FileDateTime("c:\foo\bar\qux.file")
+6
source

Use the method GetFilein FileSystemObjectand then just use the properties DateCreatedand 'DateLastModified'.

Here's the sample documentation for how to do this from VBscript (almost the same from VB6):

http://msdn.microsoft.com/en-us/library/sheydkke%28VS.85%29.aspx

+1
source

, FileSystemObject .

MS

Please note that the example works in VBScript, and also in VB6 you can get the file http://msdn.microsoft.com/en-us/library/aa716288(VS.60).aspx

t

Dim fso As New FileSystemObject, fil As File
Set fil = fso.GetFile("c:\test.txt")
+1
source
0
source

Source: https://habr.com/ru/post/1745701/


All Articles