如何获得当前正在执行文件的文件名

k2536 2004-05-04 09:54:01
如何获得当前正在告执行文件的文件名
...全文
75 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly_liuyang 2004-05-05
  • 打赏
  • 举报
回复
ParamStr(0)
jinjazz 2004-05-05
  • 打赏
  • 举报
回复
extractfilename(Application.ExeName)
k2536 2004-05-05
  • 打赏
  • 举报
回复
答者有份哈
zzzl 2004-05-05
  • 打赏
  • 举报
回复
来晚了。。。
楼主要不要得到程序在任务栏的图标?用Application.icon属性
disney 2004-05-04
  • 打赏
  • 举报
回复
要指出,这个方法只能在有Form存在时使用,做一个简单的不带窗体的简单程序时就用不上了。
用paramstr函数即可。
Returns a specified parameter from the command-line.

Unit

System

Category

command line utilities

function ParamStr(Index: Integer): string;

Description

ParamStr returns the parameter from the command line that corresponds to Index, or an empty string if Index is greater than ParamCount. For example, an Index value of 2 returns the second command-line parameter.

ParamStr(0) returns the path and file name of the executing program (for example, C:\TEST\MYPROG.EXE).

Note: Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces)
lovedata 2004-05-04
  • 打赏
  • 举报
回复
这个分数太好得到了啊~:)
chris_crow 2004-05-04
  • 打赏
  • 举报
回复
Application.ExeName;
miky 2004-05-04
  • 打赏
  • 举报
回复
Application.ExeName;

5,388

社区成员

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

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