How to get the full path to the AppData folder in Delphi?
1 answer
function GetDOSEnvVar(const VarName: string): string; var i: integer; begin Result := ''; try i := GetEnvironmentVariable(PChar(VarName), nil, 0); if i > 0 then begin SetLength(Result, i); GetEnvironmentVariable(Pchar(VarName), PChar(Result), i); end; except Result := ''; end; end; GetDOSEnvVar('AppData');
Kopipast) :)
|