procedure TForm1.btn1Click(Sender: TObject);
begin
//完整路径 E:UsrSoftDesktopFileNameDemoProject1.exe
edt1.Text := paramstr(0);
edt1.Text := Application.ExeName; //同上
//文件路径 E:UsrSoftDesktopFileNameDemo
edt2.Text := ExtractFilePath(Application.ExeName);
//文件所在文件夹 E:UsrSoftDesktopFileNameDemo
edt6.Text := ExtractFileDir(Application.ExeName);
//文件名.扩展名 Project1.exe
edt3.Text := ExtractFileName(Application.ExeName);
//.扩展名 .exe
edt4.Text := ExtractFileExt(Application.ExeName);
//去掉扩展名
edt5.Text := ChangeFileExt(ExtractFileName(Application.ExeName), ''); // Project1
edt7.Text := ChangeFileExt(Application.ExeName, ''); // E:UsrSoftDesktopFileNameDemoProject1
//更改扩展名 E:UsrSoftDesktopFileNameDemoProject1.zip
edt8.Text := ChangeFileExt(Application.ExeName, '.zip');
//更改文件名 E:UsrSoftDesktopFileNameDemoProject1_20150225154703.exe
edt9.Text := ChangeFileExt(Application.ExeName, '') +
'_' + FormatDateTime('yyyymmddhhmmss', Now) +
ExtractFileExt(Application.ExeName);
end;