帮我看看这段代码为什么不行?
本帖最后由 omegabomb 于 2009-8-4 11:07 编辑#include<GUIConstants.au3>
GUICreate("GUI",200,100)
$path=GUICtrlCreateInput("",10,20,100,20)
$select=GUICtrlCreateButton("浏览",120,20,50,20)
$confirm=GUICtrlCreateButton("写入",10,50,50,20)
GUISetState(@SW_SHOW)
While 1
$nMsg=GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $select
$selectpath=FileOpenDialog("打开",@DesktopDir,"应用程序(*.exe)")
GUICtrlSetData($path,$selectpath)
Case $confirm
IniWrite("c.ini","class","path",GUICtrlRead($path))
EndSwitch
WEnd不能在c.ini中写入对应的值,为什么呢? #include<GUIConstants.au3>
GUICreate("GUI",200,100)
$path=GUICtrlCreateInput("",10,20,100,20)
$select=GUICtrlCreateButton("浏览",120,20,50,20)
$confirm=GUICtrlCreateButton("写入",10,50,50,20)
GUISetState(@SW_SHOW)
While 1
$nMsg=GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $select
$selectpath=FileOpenDialog("打开","","应用程序(*.exe)")
GUICtrlSetData($path,$selectpath)
Case $confirm
IniWrite(@ScriptDir & "\c.ini","class","path",GUICtrlRead($path))
EndSwitch
WEnd 多谢afan帮我解决了,只是不懂,为什么一定要加@ScriptDir呢?直接c.ini,不是默认是当前目录下吗? 直接c.ini会将c.ini写到选择文件的目录下,呵呵 哦,了解了,多谢afan大哥了
页:
[1]