Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Script(client)1:
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_outfile=client.exe
- #AutoIt3Wrapper_Res_Fileversion=0.0.0.5
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
- #AutoIt3Wrapper_Res_LegalCopyright=Jeahaha
- #AutoIt3Wrapper_Res_Language=1031
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <file.au3>
- #Region ### START Koda GUI section ### Form=c:\users\timo2\desktop\programieren\autoit\tcptests\client.kxf
- $Form2 = GUICreate("", 405, 221, 253, 175)
- $Edit1 = GUICtrlCreateEdit("", 0, 0, 401, 185, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_HSCROLL,$WS_VSCROLL))
- $Input1 = GUICtrlCreateInput("", 0, 192, 321, 21)
- $Button1 = GUICtrlCreateButton("", 328, 192, 75, 25, $WS_GROUP)
- GUISetState(@SW_SHOW)
- Dim $Form2_AccelTable[1][2] = [["{ENTER}", $Button1]]
- GUISetAccelerators($Form2_AccelTable)
- #EndRegion ### END Koda GUI section ###
- $IP = "127.0.0.1" ; IP
- TCPStartUp()
- $socket = TCPConnect( $IP, 65432 )
- If $socket = -1 Then Exit
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- TCPCloseSocket( $socket )
- Exit
- Case $Button1
- $inp = GUICtrlRead( $Input1 )
- TCPSend( $socket , $inp ) ;soll dann in die edit und in die log.txt
- EndSwitch
- WEnd
- ;Script2(Server):
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_outfile=server.exe
- #AutoIt3Wrapper_Res_Fileversion=0.0.1.6
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
- #AutoIt3Wrapper_Res_LegalCopyright=Jeahaha
- #AutoIt3Wrapper_Res_Language=1031
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <file.au3>
- #Include <Timers.au3>
- #include <GuiStatusBar.au3>
- #include <ProgressConstants.au3>
- #Region ### START Koda GUI section ### Form=c:\users\timo2\desktop\programieren\autoit\tcptests\server.kxf
- $Form1 = GUICreate("", 619, 362, 192, 124)
- $Edit1 = GUICtrlCreateEdit("", 0, 0, 617, 337, BitOR($ES_READONLY,$WS_HSCROLL,$WS_VSCROLL))
- $Input1 = GUICtrlCreateInput("", 0, 336, 529, 21)
- $Button1 = GUICtrlCreateButton("", 536, 336, 75, 25, $WS_GROUP)
- GUISetState(@SW_SHOW)
- Dim $Form1_AccelTable[1][2] = [["{ENTER}", $Button1]]
- GUISetAccelerators($Form1_AccelTable)
- #EndRegion ### END Koda GUI section ###
- $IP = "127.0.0.1" ; IP
- TCPStartUp()
- $MainSocket = TCPListen($IP, 65432, 100 )
- If $MainSocket = -1 Then Exit
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- $ConnectedSocket = TCPAccept( $MainSocket)
- If $ConnectedSocket >= 0 Then
- GUICtrlSetData( $Edit1 , @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC & " " & "Eingehende Verbindung" & @CRLF, 1 )
- _FileWriteToLine( "log.txt" , 1 , @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC & " " & "Eingehende Verbindung" )
- EndIf
- $Rec = TCPRecv( $MainSocket , 128 )
- If $Rec Then
- GUICtrlSetData( $Edit1 , $Rec , 1 )
- _FileWriteToLine( "log.txt" , 1 , @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC & " " & $Rec ) ;hier soll das oben beschriebene ausgeführt werden , geht aber nicht :(
- EndIf
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement