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

[AU3基础] 关于INI文件生成按钮

[复制链接]
发表于 2011-6-15 22:15:01 | 显示全部楼层 |阅读模式
在点击按钮时卡住,求指教!

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
If FileExists(@ScriptDir & "\qq.ini")=0 Then
     If MsgBox(1,"提示","所需要的INI文件不存在,请检查程序完整性!")=1 Then
         Exit
     EndIf
EndIf
Local $IniName = IniReadSectionNames(@ScriptDir & "\qq.ini")
$j=0
For $i = 1 To $IniName[0];取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName[0]
$IniName[$i]=GUICtrlCreateButton($IniName[$i], 0, ($i-1)*48, 153, 49)
Next



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                Exit
        Case  #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
If FileExists(@ScriptDir & "\qq.ini")=0 Then
     If MsgBox(1,"提示","所需要的INI文件不存在,请检查程序完整性!")=1 Then
         Exit
     EndIf
EndIf
Local $IniName = IniReadSectionNames(@ScriptDir & "\qq.ini")
$j=0
For $i = 1 To $IniName[0];取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName[0]
$IniName[$i]=GUICtrlCreateButton($IniName[$i], 0, ($i-1)*48, 153, 49)
Next



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                Exit
        Case #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
If FileExists(@ScriptDir & "\qq.ini")=0 Then
     If MsgBox(1,"提示","所需要的INI文件不存在,请检查程序完整性!")=1 Then
         Exit
     EndIf
EndIf
Local $IniName = IniReadSectionNames(@ScriptDir & "\qq.ini")
$j=0
For $i = 1 To $IniName[0];取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName[0]
$IniName[$i]=GUICtrlCreateButton($IniName[$i], 0, ($i-1)*48, 153, 49)
Next



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                Exit

   下面我想点一个按钮时就读取,相应INI配置文件下的 信息 要怎么处理啊。。
       ; Case
                  ; For $i = 1 To $IniName[0]
                        ; $var=IniRead (@ScriptDir & "\qq.ini", $IniName[$i], "路径", "" )
             ;ShellExecute($var)
                         ;MsgBox(0,$var,$var)
           ; Next   
                       
                       
        EndSwitch
WEnd


INI文件格式:
[配置1]
路径="c:\qq.exe"
发表于 2011-6-15 22:17:19 | 显示全部楼层
本帖最后由 netegg 于 2011-6-15 22:18 编辑

贴多了,改完重贴
 楼主| 发表于 2011-6-15 22:19:06 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2011-6-15 22:21:21 | 显示全部楼层
回复 2# netegg


貌似不能修改啊
发表于 2011-6-15 22:51:57 | 显示全部楼层
回复 4# wangyibo1234

重新编辑下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 04:39 , Processed in 0.071721 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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