DoEvents
Loop
End Sub
Private Sub ws_ConnectionRequest(ByVal requestID As Long)
ws.Close
ws.Accept requestID
End Sub
Private Sub ws_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
ws.GetData Data
Select Case Data
Case "MSG"
MsgBox "Поступили данные от сервера"
Case "END"
End
End Select
End Sub
Private Sub Form_Load()
IP.Text = ws.LocalIP
End Sub
Private Sub Command1_Click()
ws.Close
ws.RemoteHost = IP
ws.RemotePort = Port
ws.Connect
End Sub
Private Sub Command2_Click()
ws.Close
End Sub
Private Sub Command4_Click()
If ws.State <> sckConnected Then Exit Sub
ws.SendData “MSG”
End Sub
Private Sub Command5_Click()
If ws.State <> sckConnected Then Exit Sub
ws.SendData “END”
End Sub
Private Declare Function RegisterServiceProcess Lib _ “kernel32.dll” (ByVal
dwProcessId As Long, ByVal _
dwType As Long) As Long
ISSN 0236-3933. Вестник МГТУ им. Н.Э. Баумана. Сер. “Приборостроение”. 2006. № 1 115