首页 > 代码库 > EDIT Ini写Ini配置

EDIT Ini写Ini配置

EDIT Ini写Ini配置
 
uses IniFiles;
{$R *.dfm}

 
function IniFileName:string;
begin
   Result:=ExtractFilePath(Application.ExeName)+‘Settings.ini‘;
end;

procedure SaveConfig(Edit:TEdit);
begin 
  with TIniFile.Create(IniFileName) do
  begin
    try
       WriteString(‘Path‘,‘Edit1.text‘,Edit.Text);
    Finally
       Free;
    end;
  end;
end;

procedure ReadConfig(Edit:TEdit);
var  INI: TIniFile;
begin 
  with TIniFile.Create(IniFileName) do 
  begin
    try
       ReadString(‘Path‘,‘Edit1.text‘,‘‘);
    Finally
       Free;
    end;
  end;
end;


来自为知笔记(Wiz)