Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstants.au3>
- Global $name1 = "Сервер1", $name2 = "Сервер2", $list1, $list2, $server
- $Form1_1 = GUICreate("Form1", 354, 572, 821, 257)
- $Button1 = GUICtrlCreateButton("Button1", 24, 520, 129, 25)
- $Combo1 = GUICtrlCreateCombo("", 16, 208, 153, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
- GUISetState(@SW_SHOW)
- $Radio1 = GUICtrlCreateRadio($name1, 8, 24, 135, 16)
- $Radio2 = GUICtrlCreateRadio($name2, 8, 55, 135, 16)
- $arr = IniReadSection("data.ini", $name1)
- For $i = 1 To $arr[0][0]
- $list1 &= "|" & $arr[$i][0]
- Next
- $arr = IniReadSection("data.ini", $name2)
- For $i = 1 To $arr[0][0]
- $list2 &= "|" & $arr[$i][0]
- Next
- While 1
- Switch GUIGetMsg()
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- Login(GUICtrlRead($Combo1))
- Case $Radio1
- GUICtrlSetData( $Combo1, $list1)
- $server = $name1
- Case $Radio2
- GUICtrlSetData($Combo1, $list2)
- $server = $name2
- EndSwitch
- WEnd
- Func Login($nick)
- Local $data = StringSplit(IniRead("data.ini", $server, $nick, ''), "|")
- If @error Then Return
- Local $user = $data[1], $pass = $data[2]
- MsgBox(0, "", "login:" & $user & @CRLF & "pass:" & $pass)
- EndFunc
- ========
- data.ini
- [Сервер1]
- nick1=p1|w1
- nick2=p2|w2
- nick3=p3|w3
- [Сервер2]
- nick2=p2|w2
- nick3=p3|w3
- nick4=p4|w4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement