在Firemonkey中获取应用程序路径

ple*_*103 14 delphi delphi-xe3 firemonkey-fm2

所以在VCL中,可以使用以下代码行来检索应用程序路径:

ExtractFilePath(Application.ExeName)
Run Code Online (Sandbox Code Playgroud)

我尝试了同样的事情Firemokey,我注意到ExeName不再可用.我可以使用哪些代码作为替代方案?

slo*_*omo 22

尝试使用ParamStr(0)而不是Application.ExeName.


小智 5

我在用着

showmessage(System.SysUtils.GetCurrentDir);
Run Code Online (Sandbox Code Playgroud)

并且很有魅力:)

  • 没有!那是错的。有人使用 System.SysUtils.setCurrentDir 将当前目录设置为其他内容是什么? (4认同)