找回密码
 加入
搜索
楼主: zhenglei

如何修改INI中的关键字???

[复制链接]
发表于 2009-3-2 11:47:43 | 显示全部楼层
$i=1
while 1
  $line = filereadline($file,$i)
  if stringinstr($line, "测试A")<>0 then
  $line=Stringreplace("测试A",GUICtrlGetData($input))
  endif
  $i=$i+1
wend
发表于 2009-3-2 13:31:33 | 显示全部楼层
原帖由 cnsnc 于 2009-2-24 10:17 发表
fileread→stringrepleace→filedelete→FileWrite
要是觉得麻烦那就 _ReplaceStringInFile

如果你确定配置文件里只有这一个关键字串的,就这样最省事了
发表于 2009-3-2 19:18:40 | 显示全部楼层
三步:
1. 使用GUICtrlRead()获得文本框控件中的“文件列表”四个字;
2. 使用IniDelete() 删除“测试A="AAAAA"”;
3. 使用IniWrite() 或IniWriteSection()写入"文件列表=AAAAA"。

OK!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 07:25 , Processed in 0.063997 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表