unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
function getfiledate(filename: string): Tdatetime;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function TForm1.getfiledate(filename: string): Tdatetime;
//获得文件时间
begin
if fileexists(filename) then
result := filedatetodatetime(fileage(filename))
else
result := maxint;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := DateTimeToStr(GetFileDate(Application.ExeName));
end;
end.