procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(ExtractFilePath(ParamStr(0))); //获取程序所在目录
ShowMessage(ExtractFilePath(Application.ExeName)); //获取程序所在目录
ShowMessage(GetCurrentDir + '\'); //获取当前目录
end;
转载于:https://my.oschina.net/hermer/blog/320542