Delphi XE - GetHomePath - 获取用户程序数据目录

Posted redhat588

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Delphi XE - GetHomePath - 获取用户程序数据目录相关的知识,希望对你有一定的参考价值。

uses System.IOUtils;

procedure TForm1.btn3Click(Sender: TObject);
var
  S: string;
begin
  { 三种方法结果一致: C:UsersAdministratorAppDataRoaming }
  S := GetHomePath;     // SysUtils, 能跨平台且简单, 在 Windows 下使用 SHGetFolderPath 完成
  mmo1.Lines.Add(S);
  S := TPath.GetHomePath;                 // System.IOUtils
  S := GetEnvironmentVariable(APPDATA); // 以前一直用这个
end;

 

以上是关于Delphi XE - GetHomePath - 获取用户程序数据目录的主要内容,如果未能解决你的问题,请参考以下文章

delphi xe 取CPU等硬件信息

delphi xe10 怎么样

delphi xe 移动开发 调用截屏

Delphi XE3写DLL,用Delphi7调用,报错!

Delphi - 需要 XE2 代码到 Delphi7。使用wininet下载文件

求救,这个delphi xe8要怎么破解