입니다. 질문을 게시 할 때 메시지 도구 모음에있는 '{}'버튼을 사용하여 코드를 입력하면 더 잘 읽을 수 있습니다.
질문에 대한 몇 가지 실수와 코드에서 빠뜨린 것들이 있습니다.
AutoIT에서 TCP/UDP 관련 작업을 수행하려면 먼저 서비스를 시작한 다음 나중에 종료해야합니다.
많은 프로그래밍 언어에서 문자열 변수는 문자열의 시작과 끝에서 2 ""를 필요로합니다. AutoIT에서도 마찬가지입니다.
TCPSend을 사용하는 경우 첫 번째 매개 변수는 소켓이며 두 번째 매개 변수는 보낼 메시지입니다.
다음은 내가 작성한 스크립트의 예입니다. 자유롭게 수정하십시오. 나는 또한 물건을 주석 처리했습니다.
#Include <ButtonConstants.Au3>
#Include <EditConstants.Au3>
#Include <GUIConstantsEx.Au3>
#Include <StaticConstants.Au3>
#Include <WindowsConstants.Au3>
#Include <GUIEdit.Au3>
#Include <Misc.Au3>
#NoTrayIcon
Opt ('GUIOnEventMode', 1)
;We are using Input boxes so the user can type in the IP/Port/Msg and they will be stored as variables for later use
$IP = InputBox("SO TCP Connector", "Receiver's IP Address", "0.0.0.0", "", _
- 1, -1, 0, 0)
$Port = InputBox("SO TCP Connector", "Receiver's Port", "80", "", _
- 1, -1, 0, 0)
$Message = InputBox("SO TCP Connector", "Message to send", "Sample text", "", _
- 1, -1, 0, 0)
;Starting the TCP service
TCPStartup()
;Opening a socket
$iSocket = TCPConnect($IP, $Port)
;Sending our message
TCPSend($iSocket, $Message)
;Closing the socket from before
TCPCloseSocket($iSocket)
;Stopping the TCP Service
TCPShutdown()
이 코드는 실제로 문제를 조사하기에 충분하지 않은 것 같습니다. 또한 서식을 지정하면 자동 시스템에서이 스팸을 고려해야하므로 편집 할 두 번째 이유가 있습니다. –
@PaulStelian 편집 방법은 무엇입니까? –