获取应用程序的路径在Firemonkey(Getting application path in F

2019-08-17 07:44发布

因此,在VCL中,应当使用下面的代码行来检索应用程序路径:

ExtractFilePath(Application.ExeName)

我Firemokey尝试同样的事情,我注意到,EXENAME不再可用。 我可以作为替代该用什么码?

Answer 1:

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



Answer 2:

我正在使用

showmessage(System.SysUtils.GetCurrentDir);

和工程就像一个魅力:)



Answer 3:

我上找到http://arcana.sivv.com/blog/ ,您可以尝试使用此:

X.Env.ExeFilename - 返回运行的可执行的实际文件名。

这里从博客的一些解释:

X.Env.SearchPath - Returns the currently registered search path on the system.
X.Env.AppFilename - Returns the "app" name of the application.  On OS X this is the application package in which the exe resides.  On Windows, this is the name of the folder in which the exe resides.
X.Env.ExeFilename - Returns the actual filename of the running executable.
X.Env.AppFolder - Returns the folder path to the executable, stopping at the level of the application package on OSX.
X.Env.ExeFolder - Returns the full folder path to the executable.
X.Env.TempFolder - Returns a writable temp folder path that can be used by your application.
X.Env.HomeFolder - Returns the user's writable home folder.  On OS X this equates to /Users/username and on Windows,  C:\Users\username\AppData\Roaming or the appropriate path as set on the system.


文章来源: Getting application path in Firemonkey