Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- #include <GUIConstantsEx.au3>
- #include <GUIConstantsEx.au3>
- GUICreate("Message", 675, 450)
- $cAusgabe = GUICtrlCreateInput("", 90, 30, 500, 150)
- $cSenden = GUICtrlCreateButton("Senden", 220, 390, 120, 25)
- GUICtrlCreateLabel("IP Adresse:", 90, 350, 120, 25)
- $cIP = GUICtrlCreateInput("", 150, 345, 120, 25)
- $cExit = GUICtrlCreateButton("Beenden", 350, 390, 120, 25)
- Local $iDummy, $aCCheckBox[14], _
- $iUB = UBound($aCCheckBox), _
- $aSCheckBox = StringSplit("Stuttgart,Dubai,Mailand,Rom,Zug,Kista,Paris,Strassburg,Wien,Hertogenbosch,Madrid,Portugal,Kopenhagen,Bracknell", ",", 3)
- For $x = 90 To 420 Step 110
- For $y = 200 To 290 Step 30
- $aCCheckBox[$iDummy] = GUICtrlCreateCheckbox($aSCheckBox[$iDummy], $x, $y, 100, 30)
- $iDummy += 1 ; Zähler erhöhen.
- If $iDummy = $iUB Then ExitLoop ; Arraygrenze erreicht.
- Next
- Next
- $cCheckall = GUICtrlCreateButton("Check all", 420, 260, 100, 25)
- $cUncheckall = GUICtrlCreateButton("Uncheck all", 420, 290, 100, 25)
- GUISetState(@SW_SHOW)
- While 1
- $msg = GUIGetMsg()
- Switch $msg
- Case $cExit, -3
- Exit
- Case $cCheckall
- For $i = 0 To UBound($aCCheckBox) - 1
- GUICtrlSetState($aCCheckBox[$i], $GUI_CHECKED)
- Next
- Case $cUncheckall
- For $i = 0 To UBound($aCCheckBox) - 1
- GUICtrlSetState($aCCheckBox[$i], $GUI_UNCHECKED)
- Next
- Case $cSenden
- $sString = ""
- For $i = 0 To UBound($aCCheckBox) - 1
- $sString &= GUICtrlRead($aCCheckBox[$i]) & "," & GUICtrlRead($aCCheckBox[$i], 1) & "|"
- Next
- $sString = StringTrimRight($sString, 1)
- MsgBox(0, "", $sString)
- $aDecode = _decode($sString)
- _ArrayDisplay($aDecode)
- ;~ $IPServer = FileRead(@ScriptDir & "\HierdieServerIPeintragen.txt")
- ;~ TCPStartup()
- ;~ Global $ConnectedSocket = TCPConnect($IPServer, 33891)
- ;~ TCPSend($ConnectedSocket, GUICtrlRead($Ausgabemessage) & $sString)
- EndSwitch
- WEnd
- Func _decode($sString)
- $aRegExp = StringRegExp($sString, "([14]),([^|]+)", 3)
- Local $aRet[UBound($aRegExp) / 2][2], $iC
- For $i = 1 To UBound($aRegExp) - 1 Step 2
- $aRet[$iC][0] = $aRegExp[$i]
- $aRet[$iC][1] = $aRegExp[$i - 1]
- $iC += 1
- Next
- Return $aRet
- EndFunc ;==>_decode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement