exe所在路径

procedure TForm1.btn1Click(Sender: TObject);
begin
//完整路径 E:\UsrSoft\Desktop\FileNameDemo\Project1.exe
edt1.Text := paramstr(0);
edt1.Text := Application.ExeName; //同上 //文件路径 E:\UsrSoft\Desktop\FileNameDemo\
edt2.Text := ExtractFilePath(Application.ExeName); //文件所在文件夹 E:\UsrSoft\Desktop\FileNameDemo
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:\UsrSoft\Desktop\FileNameDemo\Project1 //更改扩展名 E:\UsrSoft\Desktop\FileNameDemo\Project1.zip
edt8.Text := ChangeFileExt(Application.ExeName, '.zip'); //更改文件名 E:\UsrSoft\Desktop\FileNameDemo\Project1_20150225154703.exe
edt9.Text := ChangeFileExt(Application.ExeName, '') +
'_' + FormatDateTime('yyyymmddhhmmss', Now) +
ExtractFileExt(Application.ExeName);
end;

exe所在路径

上一篇:JDBC代码


下一篇:Mac下 Windows 7 虚拟机搭建SVN服务器的详细步骤(此方法同样适用于单纯的Windows系统搭建SVN)