→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎04-01-2008 01:15 AM
#include <GUIConstants.au3>
Opt("TrayIconHide", 1)
TCPStartup()
Dim $szServerPC = $cmdline[1]
Dim $szIPADDRESS = TCPNameToIP($szServerPC)
Dim $nPORT = 5555
Dim $ConnectedSocket = -1
While $ConnectedSocket = -1
$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
WEnd
Dim $szData
If @error Then
MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error)
Else
While 1
$szData = InputBox("My NetSender!", @LF & @LF & "Enter text to send to " & $cmdline[1] & "(" & $szIPADDRESS & "):")
$szData = $szData
If @error Or $szData = "" Then ExitLoop
TCPSend($ConnectedSocket, $szData)
If @error Then ExitLoop
WEnd
EndIf
#include <GUIConstants.au3>
#include <Constants.au3>
Opt("TrayIconHide", 1)
Dim $szIPADDRESS = @IPAddress1
Dim $nPORT = 5555
TCPStartUp()
$MainSocket = TCPListen($szIPADDRESS, $nPORT)
If $MainSocket = -1 Then Exit
Dim $ConnectedSocket = -1
Do
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1
Dim $szIP_Accepted = SocketToIP($ConnectedSocket)
Dim $msg, $recv
While 1
$msg = GUIGetMsg()
$recv = TCPRecv( $ConnectedSocket, 2048 )
If @error Then ExitLoop
if $recv <> "" Then MsgBox(262208,"Message",$recv)
WEnd
If $ConnectedSocket <> -1 Then TCPCloseSocket( $ConnectedSocket )
TCPShutDown()
Func SocketToIP($SHOCKET)
Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]")
Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _
"ptr",DLLStructGetPtr($sockaddr),"int_ptr",DLLStructGetSize($sockaddr))
If Not @error And $aRet[0] = 0 Then
$aRet = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3))
If Not @error Then $aRet = $aRet[0]
Else
$aRet = 0
EndIf
$sockaddr = 0
Return $aRet
EndFunc
cmd.exe /K \\server\share$\Lansweeper\psexec.exe \\{computer} -c -s -i \\server\share$\Lansweeper\receive.exe | \\server\share$\Lansweeper\send.exe {computer}
‎10-09-2008 06:38 PM
‎09-22-2008 07:56 PM
‎04-21-2008 07:40 PM
‎04-21-2008 06:48 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now