ini文件?

Fallingstar 2002-10-13 04:09:28
怎样打开ini文件,并进行读写?
...全文
32 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly_liuyang 2002-10-13
  • 打赏
  • 举报
回复
都说完了,还要加上uses inifiles;
goodloop 2002-10-13
  • 打赏
  • 举报
回复
IniFile:=TIniFile.Create('F:\Borland\2000\Delphi6\WallPaperMaker.ini');

IniFile.WriteBool('name1','name2',true);
IniFile.WriteString('name3','Path',STV.SelectedFolder.PathName);
IniFile.WriteString('name4','MovePath',MovePath);
IniFIle.Free;

这是写入ini的程序。格式也是上面那个样子
goodloop 2002-10-13
  • 打赏
  • 举报
回复
IniFile:=TIniFile.Create('F:\Borland\2000\Delphi6\WallPaperMaker.ini');

DirectDelete:=IniFile.ReadBool('name1','name2',true);
STV.Path:=IniFile.ReadString('name3','Path',STV.SelectedFolder.PathName);
MovePath:=IniFile.ReadString('name4','MovePath',MovePath);
IniFIle.Free;

ini 里是这个样子
[name1]
name2=1
[name3]
Path=D:\Documents and Settings\Administrator\桌面
[name4]
MovePath=C:\Documents and Settings\Administrator\My Documents\My Music

对照着看应该能明白

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧