这个也正是我需要的,在你的基础上搜索了一下
ControlGetText($Form1, "", $Combo1)) 可以读取下拉列表的数据,但是在界面循环中需要添加一个按钮来执行,我直接加到退出的那个X上了,运行以后选择,然后点X试试看
而且很奇怪你为什么加了那么多include,需要哪个就加上,不需要的就去掉多好
#NoTrayIcon
#include <IE.au3>
#include <Misc.au3>
#include <Date.au3>
#include <INet.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$path = @ScriptDir & "\Setting.ini"
If Not FileExists($path) Then
IniWrite($path, "配置", "用户名", "")
IniWrite($path, "配置", "密码", "")
EndIf
$user = IniRead($path, "配置", "用户名", "")
$pwd = IniRead($path, "配置", "密码", "")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 256, 115, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 40, 32, 145, 25)
GUISetState(@SW_SHOW)
$var = IniReadSectionNames("setting.ini")
If @error Then
MsgBox(4096, "", "错误, 读取INI文件失败.")
Else
For $i = 1 To $var[0]
$a = GUICtrlSetData($Combo1, $var[$i])
Next
EndIf
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
MsgBox(0, "你选中了:", ControlGetText($Form1, "", $Combo1))
ExitLoop
EndSwitch
WEnd
$user = IniRead($path, ControlGetText($Form1, "", $Combo1), "用户名", "")
$pwd = IniRead($path, ControlGetText($Form1, "", $Combo1), "密码", "") ;
MsgBox(0, $user, $pwd)
|