用Delphi读写ini文件

uses

    IniFiles;

Function INIReadString(aFilePath,const Section, Ident, Default: string):String;
Var
MyIniFile:TInifile;
Begin
Result := Default;
If
Try
MyIniFile:=TInifile.Create(aFilePath);
Result := MyIniFile.ReadString(Section,Ident,Default);
Fillay
MyIniFile.Free;
End;
End;

Function INIWriteString(aFilePath,const Section, Ident, aStr: string):Boolean;
Var
MyIniFile:TInifile;
Begin
Result := False;
Try
MyIniFile:=TInifile.Create(aFilePath);
MyIniFile.WriteString(Section,Ident,aStr);
Result := True;
Fillay
MyIniFile.Free;
End;
End;

posted @ 2008-04-21 19:01  莫忆往西  阅读(221)  评论(0编辑  收藏  举报