Delphi 读取配置文件INI

孤人 提交于 2019-12-01 10:15:44

//读取配置文件INI

function ReadIniItem(const Section, Item,IniFileName,
DefaultValue: String): string;
var
Value:string;
begin
SetLength(Value,3001*sizeof(Char));
GetPrivateProfileString(PChar(Section),PChar(Item),
'',PChar(Value),3000,PChar(ExtractFilePath(Paramstr(0))+IniFileName));
SetLength(Value,StrLen(PChar(Value)));
if Trim(Value)<>'' then Result:=Value
else Result:=DefaultValue;
end;
View Code

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!