Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi TPath und spezielle Verzeichnisse wie AppData\Roaming (https://www.delphipraxis.net/180799-tpath-und-spezielle-verzeichnisse-wie-appdata%5Croaming.html)

Der schöne Günther 18. Jun 2014 14:14

TPath und spezielle Verzeichnisse wie AppData\Roaming
 
Ich möchte, als Beispiel, den %AppData%-Pfad des Benutzers haben. Also beispielsweise C:\Users\Heinz Rühmann\AppData\Roaming. Das wurde schon tausend mal gefragt.

Meine Frage:
Delphi-Quellcode:
System.IOUtils.TPath
hat Methoden wie
Delphi-Quellcode:
GetLibraryPath(): String
oder
Delphi-Quellcode:
GetRingtonesPath(): String
. Das sind allesamt eher Handy OS-Methoden. Ich finde nichts- Gibt es für die Windows-Welt keinen Wrapper für AppData\Local und ähnliches?

Muss ich weiterhin WinApi-Methoden wie bsp.
Delphi-Quellcode:
SHGetSpecialFolderPath
verwenden und dabei wahrscheinlich noch auf die Windows-Version achten?

matthiaskary 18. Jun 2014 14:24

AW: TPath und spezielle Verzeichnisse wie AppData\Roaming
 
Hallo,

die Pfade klappen unter Windows ebenso wie unter OS, Android usw.


ShowMessage(TPath.GetSharedDocumentsPath);
liefert z.b. unter Windows - C:\Users\Public\Documents
oder
ShowMessage(TPath.GetHomePath);
liefert z.B. unter Windows - C:\Users\Administrator\Appdata\Roaming

Thomas_K 18. Jun 2014 14:29

AW: TPath und spezielle Verzeichnisse wie AppData\Roaming
 
Das ganze is hier http://docwiki.embarcadero.com/Libra...th.GetHomePath ganz gut erklärt.

Der schöne Günther 18. Jun 2014 18:09

AW: TPath und spezielle Verzeichnisse wie AppData\Roaming
 
Vielen Dank.

GetHomePath(). Der "HomePath" bezeichnet, zumindest unter Windows, eigentlich den Profilordner des Benutzers, z.B. c:\users\Heinz deshalb habe ich dort erst gar nicht geschaut. :roteyes:


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz