Delphi读取utf8格式ini及取得动态�热�


本文整理自网络,侵删。

 使用Delphi?x取utf8格式?r需使用Tmeminifile,另外??B取得的?例。

VAR SYSINI: TMemIniFile; // ?x取utf8格式的ini需使用TMemIniFile
ts:tstringlist;
i:integer;
ApplicationPath:string;
begin
// 先取得目前?绦新??
ApplicationPath := ExtractFilePath(Application.exename);
if ApplicationPath[length(ApplicationPath)] = ‘\’ then
begin
ApplicationPath := copy(ApplicationPath, 1, length(ApplicationPath) ?C 1);
end;
// ?x取sys.ini?e的memberid?^?K?K?@示值
MEMO1.Lines.Clear;
ts:=tstringlist.Create;
SYSini := TMemIniFile.Create(ApplicationPath+’\sys.ini’,TEncoding.UTF8);
if NOT (SYSini = nil) then begin
sysini.ReadSection(‘memberid’,ts);
for I:=0 TO TS.Count-1 DO BEGIN
MEMO1.Lines.Add(TS[I]);
MEMO1.LINES.Add(sysini.ReadString(‘MEMBERID’,TS[I],"));
END;
end;
ts.Free;
end;

相关阅读 >>

Delphi 的tjpegimage跟image区别

Delphi结合winrar生成自解压文件

Delphi 简单的字符串加密和解密

Delphi 让scrollbox响应鼠标的滚动消息

Delphi 按esc快捷键退出程序的简单方法

Delphi 监视剪贴板内容

Delphi 调用打印软件代码

Delphi定时器相关的简单例子

Delphi 获取某个页面所有的链接

Delphi simple resource api replacement

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...