找回密码
 加入
搜索
查看: 1454|回复: 4

inputbox 裏面的內容怎麼寫進 *.INI 的文件中

  [复制链接]
发表于 2010-1-25 00:18:50 | 显示全部楼层 |阅读模式
代碼如下,執行后沒有生成test.INI 文件

#include<guiconstantsex.au3>
Global $file, $msg ,$mem[7]
Global $ini[quote][/quote]
GUICreate("HDinfo",600,600,200,80)
GUICtrlCreateLabel("SYS path :",5,22,50,22)
guictrlcreatelabel("  Memry  :",5,52,50,22)
GUICtrlCreateLabel("Local File :",250,22,100,22)
guictrlcreatelabel("Local Memry:",250,52,80,22)
$file=GUICtrlCreateInput(""&@WindowsDir,55,20,150,20)
$mem=MemGetStats()
$M=GUICtrlCreateInput(""&$mem[1]/(1024)&" M",55,50,150,20)
$LOCALFILE=GUICtrlCreateInput("",330,20,150,20)
$localmem=GUICtrlCreateInput("",330,50,150,20)

$ini="c:\test.ini"
$input1=$file
IniWriteSection($ini,"windows path",$input1)

GUISetState(@sw_show)

While 1
        $msg=GUIGetMsg()
        Select
        Case $msg=$gui_event_close
                ExitLoop
        EndSelect
WEnd
Exit
发表于 2010-1-25 08:17:33 | 显示全部楼层
建议LZ多看看帮助,多用论坛搜索。
IniWriteSection ( "文件名", "字段", "数据" [, 索引] )
(需要写入的“数据”. 数据请按照标准的INI文件格式写入 “键 = 值” 这样成对的写入,如果有多行,请使用 @LF 换行.)

Global $ini[quote][/quote] 这里请改改
这里换成:
$input1="windir="&GUICtrlRead($file)
IniWriteSection($ini,"windows path",$input1)
发表于 2010-1-25 08:37:29 | 显示全部楼层
GUICtrlRead($file)
应该用读取值的方式,直接用变量返回的是句柄而非内容!
 楼主| 发表于 2010-1-25 09:10:01 | 显示全部楼层
谢谢 我会努力学习的
发表于 2010-1-25 09:11:52 | 显示全部楼层
我开始也犯过同样错误,谢谢,学习了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 14:36 , Processed in 0.080924 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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