SHARE
TWEET

Untitled

a guest May 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Array.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <GUIConstantsEx.au3>
  4.  
  5. GUICreate("Message", 675, 450)
  6. $cAusgabe = GUICtrlCreateInput("", 90, 30, 500, 150)
  7. $cSenden = GUICtrlCreateButton("Senden", 220, 390, 120, 25)
  8. GUICtrlCreateLabel("IP Adresse:", 90, 350, 120, 25)
  9. $cIP = GUICtrlCreateInput("", 150, 345, 120, 25)
  10. $cExit = GUICtrlCreateButton("Beenden", 350, 390, 120, 25)
  11. Local $iDummy, $aCCheckBox[14], _
  12.         $iUB = UBound($aCCheckBox), _
  13.         $aSCheckBox = StringSplit("Stuttgart,Dubai,Mailand,Rom,Zug,Kista,Paris,Strassburg,Wien,Hertogenbosch,Madrid,Portugal,Kopenhagen,Bracknell", ",", 3)
  14.  
  15. For $x = 90 To 420 Step 110
  16.     For $y = 200 To 290 Step 30
  17.         $aCCheckBox[$iDummy] = GUICtrlCreateCheckbox($aSCheckBox[$iDummy], $x, $y, 100, 30)
  18.         $iDummy += 1 ; Zähler erhöhen.
  19.         If $iDummy = $iUB Then ExitLoop ; Arraygrenze erreicht.
  20.     Next
  21. Next
  22.  
  23. $cCheckall = GUICtrlCreateButton("Check all", 420, 260, 100, 25)
  24. $cUncheckall = GUICtrlCreateButton("Uncheck all", 420, 290, 100, 25)
  25. GUISetState(@SW_SHOW)
  26.  
  27.  
  28. While 1
  29.     $msg = GUIGetMsg()
  30.     Switch $msg
  31.         Case $cExit, -3
  32.             Exit
  33.         Case $cCheckall
  34.             For $i = 0 To UBound($aCCheckBox) - 1
  35.                 GUICtrlSetState($aCCheckBox[$i], $GUI_CHECKED)
  36.             Next
  37.         Case $cUncheckall
  38.             For $i = 0 To UBound($aCCheckBox) - 1
  39.                 GUICtrlSetState($aCCheckBox[$i], $GUI_UNCHECKED)
  40.             Next
  41.         Case $cSenden
  42.             $sString = ""
  43.             For $i = 0 To UBound($aCCheckBox) - 1
  44.                 $sString &= GUICtrlRead($aCCheckBox[$i]) & "," & GUICtrlRead($aCCheckBox[$i], 1) & "|"
  45.             Next
  46.             $sString = StringTrimRight($sString, 1)
  47.  
  48.             MsgBox(0, "", $sString)
  49.             $aDecode = _decode($sString)
  50.             _ArrayDisplay($aDecode)
  51.  
  52. ;~          $IPServer = FileRead(@ScriptDir & "\HierdieServerIPeintragen.txt")
  53. ;~          TCPStartup()
  54. ;~          Global $ConnectedSocket = TCPConnect($IPServer, 33891)
  55. ;~          TCPSend($ConnectedSocket, GUICtrlRead($Ausgabemessage) & $sString)
  56.     EndSwitch
  57. WEnd
  58.  
  59. Func _decode($sString)
  60.     $aRegExp = StringRegExp($sString, "([14]),([^|]+)", 3)
  61.     Local $aRet[UBound($aRegExp) / 2][2], $iC
  62.     For $i = 1 To UBound($aRegExp) - 1 Step 2
  63.         $aRet[$iC][0] = $aRegExp[$i]
  64.         $aRet[$iC][1] = $aRegExp[$i - 1]
  65.         $iC += 1
  66.     Next
  67.     Return $aRet
  68. EndFunc   ;==>_decode
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top