敬业的IT人 >> 编程开发 >> Delphi >> INI文件的读写

INI文件的读写

敬业的IT人 互联网 佚名 2008-1-4 16:55:21

function readInifile(fileName,section,Ident:string):string;? //读取配置文件
var
? ini:tinifile;
begin
? ini:=tinifile.Create(fileName);
? result:=ini.ReadString(section,ident,'');
? ini.Free;
end;

procedure writeInifile(const fileName,Section, Ident, Value: string); //写inifile
var
? ini:tinifile; aPathName:string;
begin
? try
??? aPathName:= ExtractFileDir(fileName);
??? if not DirectoryExists(aPathName) then
????? ForceDirectories(aPathName);

??? ini:=tinifile.Create(fileName);
??? ini.WriteString(Section, Ident, Value);
??? ini.Free;
? except
? end;
end;

粤ICP备06119539号
Copyright CiscoSky.Org,Some Rights Reserved.
Email:me1228#tom.com