|
服务器的
服务器的IP
$g_IP = "192.168.1.78";服务器的IP
TCPStartUp()
$MainSocket = TCPListen($g_IP, 8888, 3 )
While 1
$ConnectedSocket = TCPAccept( $MainSocket)
If $ConnectedSocket >= 0 Then
$ip = @IPAddress1
$result = StringTrimLeft($ip,10)
For $i=16 To 16
If $i = $result Then
ProcessClose("rsserver.exe")
Sleep(100)
RunWait(@ComSpec & " /c " & 'sc stop RsServer', "", @SW_HIDE);不存在则自动运行
RunWait(@ComSpec & " /c " & 'sc stop RsNServer', "", @SW_HIDE);不存在则自动运行
Sleep(1000)
RunWait(@ComSpec & " /c " & 'sc start RsServer', "", @SW_HIDE);不存在则自动运行
RunWait(@ComSpec & " /c " & 'sc start RsNServer', "", @SW_HIDE);不存在则自动运行
Else
Sleep(1000)
EndIf
客户机
#NoTrayIcon
$g_IP = "192.168.1.78"
TCPStartUp()
$socket = TCPConnect( $g_IP, 8888 );连接到服务器
If $socket = -1 Then Exit |
|