Thema: Delphi INI-Probleme!

Einzelnen Beitrag anzeigen

sonic2000

Registriert seit: 15. Apr 2006
Ort: Hailbronn
24 Beiträge
 
Delphi 2005 Architect
 
#15

Re: INI-Probleme!

  Alt 7. Mai 2006, 23:43
So hier:

Delphi-Quellcode:
unit _MAINFORM;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdTelnet, XPMan, Menus, INIFiles;

.
..
...
.
..
...

procedure TMAINFORM.SaveLoginData1Click(Sender: TObject);
var ini: TIniFile;
begin
  INI := TINIFile.Create(ExtractFilePath(ParamStr(0))+
  'TTC.ini');
  INI.WriteString('CONNECTION_INFO','IP-Address',Edit1.Text);
  INI.WriteString('CONNECTION_INFO','TCP-Port',Edit2.Text);
  INI.WriteString('CONNECTION_INFO','UDP-Port',Edit3.Text);
  INI.WriteString('LOGIN_INFO','Login Name',Edit4.Text);
  INI.WriteString('LOGIN_INFO','Password',Edit5.Text);
  INI.Free;
end;

procedure TMAINFORM.LoadLoginData1Click(Sender: TObject);
var ini: TIniFile;
begin
  ini:=TIniFile.Create('TTC.ini');
  try
   Edit1.Text := Ini.ReadString('CONNECTION_INFO', 'IP-Address','Standart-Text');
  finally
    ini.free;
  end;
end;

end.
André
  Mit Zitat antworten Zitat