Author Topic: IFile.DateCreated Property  (Read 2959 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
  • User-Rate: +209/-0
  • Gender: Male
IFile.DateCreated Property
« on: July 14, 2008, 04:18:59 AM »

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

JScript

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

VBScript

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

PowerBASIC

Code: [Select]
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