//写入IniFile
function WriteIniFiles(Section: string; KeyName: string; KeyValue: string): Boolean;
var
MyIniFile: TiniFile;
begin
if (Section = '') or (KeyName = '') or (KeyValue = '') then
begin
Result := False;
exit;
end;
MyIniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + '/Config.ini');
MyIniFile.WriteString(Section, KeyName, KeyValue);
MyIniFile.Free;
Result := True;
end;
---------------------------------------------------------------------------------------------------------------
//读IniFile
function ReadIniFiles(Section: string; KeyName: string; KeyValue: string): string;
var
MyIniFile: TiniFile;
begin
if (Section = '') or (KeyName = '') or (KeyValue = '') then
begin
Result := '';
exit;
end;
MyIniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + '/Config.ini');
Result := MyIniFile.ReadString(Section, KeyName, KeyValue);
MyIniFile.Free;
end;