打印本文 打印本文 关闭窗口 关闭窗口
INI文件的读写
作者:武汉SEO闵涛  文章来源:敏韬网  点击数680  更新时间:2009/4/23 18:31:06  文章录入:mintao  责任编辑:mintao

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;

打印本文 打印本文 关闭窗口 关闭窗口