![]() |
Änderungsdatum = Erstellerdatum
Hi!
Wie kann ich bei einer Datei das Änderungsdatum durch das Ersteller datum Ändern? Oder geht das überhaupt nich? Wenn ja wie? (Delphi-Code) Danke schon im voraus! |
Re: Änderungsdatum = Erstellerdatum
Hallo,
Um alle 3 File-Datums zu ändern:
Delphi-Quellcode:
Zum Auslesen des gewünschten Datums benutze
VAR
SysT : TSystemTime; FileT : TFileTime; aHandle : THandle; BEGIN SysT.wDay := 1; SysT.wYear := 2001; SysT.wMonth := 3; SysT.wHour := 4; SysT.wMinute := 5; SysT.wSecond := 6; SystemTimeToFileTime(SysT, FileT); aHandle := CreateFile(PChar('C:\test.txt'), GENERIC_WRITE, 0, NIL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0); //PSDK: //BOOL SetFileTime( // HANDLE hFile, // const FILETIME* lpCreationTime, // const FILETIME* lpLastAccessTime, // const FILETIME* lpLastWriteTime //); SetFileTime(aHandle, @FileT, @FileT, @FileT); CloseHandle(aHandle);
Delphi-Quellcode:
function GetFileTime(hFile: THandle; lpCreationTime, lpLastAccessTime, lpLastWriteTime: PFileTime): BOOL; stdcall;
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:30 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz