Home  |  Delphi .net Home  |  System.IO.Directory  |  SetCreationTime Method
SetCreationTime  
Method  
Sets the specified Directory (folder) Creation date and time
Directory Class
System.IO NameSpace
CF1.  Procedure SetCreationTime ( PathString:StringPathString : String; DateAndTime : DateTime; ) ; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The creation date and time of the specified absolute or relative PathString directory (folder) is set to the specified DateAndTime value.
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
Microsoft MSDN Links
System.IO
System.IO.Directory
 
 
Creating a folder, and changing the creation date
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  Path : String;

begin
  // Create a new folder
  Path := 'C:\Delphi testing';
  System.IO.Directory.CreateDirectory(Path);

  // Show the folder creation date and time
  Console.WriteLine(System.IO.Directory.GetCreationTime(Path));

  // Change the creation date and time
  System.IO.Directory.SetCreationTime(Path, DateTime.Create(2000, 1, 1));

  // Show the folder creation date and time again
  Console.WriteLine(System.IO.Directory.GetCreationTime(Path));

  // Delete this temporary folder
  System.IO.Directory.Delete(Path);

  Console.Readline;
end.
Show full unit code
  22/09/2004 09:14:50
  01/01/2000 00:00:00
 
 
Delphi Programming © Neil Moffatt All rights reserved.  |  Contact the author