SetCreationTime(FileName: String; CreationTime: DateTime);
FileName. Path and name of the file, which date and time of creation must be changed.
CreationTime. Date and time that should be set.
The SetCreationTime method changes date and time of file creation passed by the FileName parameter.
The method is supported only in Windows.
Executing the example requires the C:\New_folder\1.txt file.
Add a link to the IO system assembly.
Sub UserProc;
Begin
If File.Exists("c:\New_folder\1.txt") Then
File.SetCreationTime("c:\New_folder\1.txt",DateTime.Now);
End If;
End Sub UserProc;
After executing the example it is checked if the C:\New_folder\1.txt file exists. If the file exists, its creation date will be replaced with the current one.
See also: