如何获取程序所在路径?

harabi 2003-08-20 03:24:00
见题
...全文
32 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
hailang_zh 2003-08-20
  • 打赏
  • 举报
回复
extractfilepath(application.exename);
sanjin 2003-08-20
  • 打赏
  • 举报
回复
ExtractFilePath(ParamStr(0));
lishen 2003-08-20
  • 打赏
  • 举报
回复

getdir(0,bpath);

bpath变量中存的就是路径!
江山易改 2003-08-20
  • 打赏
  • 举报
回复
ExtractFileDir(Application.Exename)
lean77 2003-08-20
  • 打赏
  • 举报
回复
这么多重复答案
lishen 2003-08-20
  • 打赏
  • 举报
回复
var
path,bpath:string;
begin
getdir(0,bpath);
path:=bpath+'\HELP.hlp';
charles2118 2003-08-20
  • 打赏
  • 举报
回复
s:=ExtractFilePath(Application.ExeName);
lxpbuaa 2003-08-20
  • 打赏
  • 举报
回复
ExtractFilePath(Application.ExeName)或者
ExtractFilePath(ParamStr(0))

————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
pdcdiy163 2003-08-20
  • 打赏
  • 举报
回复
ShowMessage(ExtractFilePath(Application.ExeName));
IORILI 2003-08-20
  • 打赏
  • 举报
回复
extractfilepath(application.exename);
hongqi162 2003-08-20
  • 打赏
  • 举报
回复
function TForm1.PathExeDir: string;
var FileName:string;
begin
FileName:=application.GetNamePath;
Result := ExtractFilePath(ParamStr(0)) + FileName;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:= PathExeDir;
end;
d983074 2003-08-20
  • 打赏
  • 举报
回复
extractfilepath(application.exename);
lirail 2003-08-20
  • 打赏
  • 举报
回复
ExtractFilePath(paramstr(0));
harabi 2003-08-20
  • 打赏
  • 举报
回复
我的桌面快捷方式的默认路径跟主程序路径不同
charles2118 2003-08-20
  • 打赏
  • 举报
回复
ExtractFilePath()
zhuojohn 2003-08-20
  • 打赏
  • 举报
回复
procedure TForm.GetAppDir(var AppDir: string);
var
hModule:THandle;
buf:array [0..MAX_PATH-1] of char;
begin
hModule:=GetModuleHandle(nil);
GetModuleFileName(hmodule,buf,sizeof(buf));
AppDir:=buf;
end;
WWWWA 2003-08-20
  • 打赏
  • 举报
回复
extractfilepath('c:123\cc.exe')
WWWWA 2003-08-20
  • 打赏
  • 举报
回复
extractfilepath('c:123\cc.exe')

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧