Delphi FMX GetAppPath 获取APP路径


本文整理自网络,侵删。

 
uses
  Androidapi.JNIBridge,
  Androidapi.IOUtils,

function GetAppPath: string;
begin
{$IF Defined(ANDROID)}
  Result := ExtractFilePath(
    ExcludeTrailingPathDelimiter(
    System.IOUtils.TPath.GetHomePath));
{$ELSE}
  Result := ExtractFilePath(ParamStr(0));
{$ENDIF ANDROID}
  Result := IncludeTrailingPathDelimiter(Result);
end;



 Memo1.Lines.Add( GetAppPath);  //结果:/data/user/0/com.embarcadero.HeaderFooterApplication/
 Memo1.Lines.Add( TPath.GetHomePath);  //结果:/data/user/0/com.embarcadero.HeaderFooterApplication/files

相关阅读 >>

Delphi httpserver 使用方法

Delphi getfileversion 获取文件版本

Delphi unigui中cookies使用中文汉字的方法

Delphi 比较图片是否相同

Delphi 下载并运行的代码

Delphi searchbox1 基本用法

Delphi 通过程序窗体句柄获取程序路径

Delphi程序支持外部参数

Delphi txt日志log

Delphi 关于 beep、messagebeep 和 windows.beep

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...