INI文件的读写
2006-02-04 13:50:28 来源:WEB开发网核心提示:function readInifile(fileName,section,Ident:string):string;? //读取配置文件var? ini:tinifile;begin? ini:=tinifile.Create(fileName);? result:=ini.ReadString(section,id
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;
更多精彩
赞助商链接