• Welcome to Jose's Read Only Forum 2023.
 

IFile.DateCreated Property

Started by José Roca, July 14, 2008, 04:18:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the DateCreated property with a file:

JScript


function ShowFileInfo(filespec)
{
   var fso, f, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFile(filespec);
   s = "Created: " + f.DateCreated;
   return(s);
}


VBScript


Function ShowFileInfo(filespec)
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   ShowFileInfo = "Created: " & f.DateCreated
End Function


PowerBASIC


FUNCTION ShowFileInfo (BYVAL filespec AS STRING) AS STRING

   LOCAL fso AS IFileSystem
   LOCAL f AS IFile
   
   fso = NEWCOM "Scripting.FileSystemObject")
   f = fso.GetFile(UCODE$(filespec))
   FUNCTION = "Created: " & PB_VariantDateToString(f.DateCreated)

END FUNCTION