Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.33 KB | None | 0 0
  1. #include <GUIConstants.au3>
  2.  
  3. Global $name1 = "Сервер1", $name2 = "Сервер2", $list1, $list2, $server
  4.  
  5. $Form1_1 = GUICreate("Form1", 354, 572, 821, 257)
  6. $Button1 = GUICtrlCreateButton("Button1", 24, 520, 129, 25)
  7. $Combo1 = GUICtrlCreateCombo("", 16, 208, 153, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
  8. GUISetState(@SW_SHOW)
  9. $Radio1 = GUICtrlCreateRadio($name1, 8, 24, 135, 16)
  10. $Radio2 = GUICtrlCreateRadio($name2, 8, 55, 135, 16)
  11.  
  12. $arr = IniReadSection("data.ini", $name1)
  13. For $i = 1 To $arr[0][0]
  14.   $list1 &= "|" & $arr[$i][0]
  15. Next
  16. $arr = IniReadSection("data.ini", $name2)
  17. For $i = 1 To $arr[0][0]
  18.   $list2 &= "|" & $arr[$i][0]
  19. Next
  20.  
  21. While 1
  22.   Switch GUIGetMsg()
  23.     Case $GUI_EVENT_CLOSE
  24.       Exit
  25.     Case $Button1
  26.       Login(GUICtrlRead($Combo1))
  27.     Case $Radio1
  28.       GUICtrlSetData( $Combo1, $list1)
  29.       $server = $name1
  30.     Case $Radio2
  31.       GUICtrlSetData($Combo1, $list2)
  32.       $server = $name2
  33.   EndSwitch
  34. WEnd
  35.  
  36. Func Login($nick)
  37.   Local $data = StringSplit(IniRead("data.ini", $server, $nick, ''), "|")
  38.   If @error Then Return
  39.   Local $user = $data[1], $pass = $data[2]
  40.   MsgBox(0, "", "login:" & $user & @CRLF & "pass:" & $pass)
  41. EndFunc
  42.  
  43.  
  44. ========
  45. data.ini
  46.  
  47. [Сервер1]
  48. nick1=p1|w1
  49. nick2=p2|w2
  50. nick3=p3|w3
  51.  
  52. [Сервер2]
  53. nick2=p2|w2
  54. nick3=p3|w3
  55. nick4=p4|w4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement