AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Änderungsdatum = Erstellerdatum

Ein Thema von bixi400 · begonnen am 17. Sep 2003 · letzter Beitrag vom 19. Sep 2003
Antwort Antwort
Benutzerbild von bixi400
bixi400

Registriert seit: 19. Mai 2003
179 Beiträge
 
Turbo Delphi für Win32
 
#1

Änderungsdatum = Erstellerdatum

  Alt 17. Sep 2003, 18:50
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!
  Mit Zitat antworten Zitat
Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: Änderungsdatum = Erstellerdatum

  Alt 19. Sep 2003, 07:05
Hallo,

Um alle 3 File-Datums zu ändern:

Delphi-Quellcode:
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);
Zum Auslesen des gewünschten Datums benutze
function GetFileTime(hFile: THandle; lpCreationTime, lpLastAccessTime, lpLastWriteTime: PFileTime): BOOL; stdcall;
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:35 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz