Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming! |
⤷ Get the last access date to file
Using Win32FindData structure you can find file's last access time in TFileTime type. Use FileTimeToSystemTime function for getting variable of the SystemTime structure, which holds the file's last access time.
procedure TForm1.Button1Click(Sender: TObject);
var
MyS: TWin32FindData;
MyTime: TFileTime;
MySysTime: TSystemTime;
begin
if Edit1.text<>'' then
begin
FindFirstFile(PChar(Edit1.Text), MyS);
MyTime:=MyS.ftLastAccessTime;
FileTimeToSystemTime(MyTime, MySysTime);
Label1.Caption:='Last Access - '+
IntToStr(MySysTime.wDay)+
'.'+
IntToStr(MySysTime.wMonth)+
'.'+
IntToStr(MySysTime.wYear);
end;
end;
- Related components
- TFileSearch
- TFolderMonitor
- TFileVersion
-
More for developers