Einzelnen Beitrag anzeigen

AlexII

Registriert seit: 28. Apr 2008
1.717 Beiträge
 
FreePascal / Lazarus
 
#28

Re: In .ini ohne Adminrechte speichern?

  Alt 26. Mär 2009, 21:09
Zitat von DeddyH:
Ich vermute einfach mal, dass Du die Ini ungefähr so erzeugst:Ini := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'Ininame.ini'); Versuch es also mal mit einem anderen Verzeichnis.
Delphi-Quellcode:
uses SHFolder;

function GetUserdataPath(out sPath: string): Boolean;
begin
  SetLength(sPath,MAX_PATH);
  SHGetFolderPath(0,CSIDL_APPDATA,0,0,PAnsiChar(sPath));
  SetLength(sPath,StrLen(PAnsiChar(sPath)));
  Result := Length(sPath) > 0;
  if Result then
    sPath := IncludeTrailingPathDelimiter(sPath);
end;
Etwa so:

Delphi-Quellcode:
var dir String;

Ini := TIniFile.Create(ExtractFilePath(GetUserdataPath(dir)) + 'Ininame.ini');
  Mit Zitat antworten Zitat