Private iButton As Integer
Private Sub Command1_Click()
iButton = 1
ConnectWinsock
End Sub
Private Sub Command2_Click()
iButton = 2
ConnectWinsock
End Sub
Private Sub Command3_Click()
iButton = 3
ConnectWinsock
End Sub
Private Sub ConnectWinsock()
Winsock1.Close
Winsock1.Connect "192.168.1.1", 23
End Sub
Private Sub Winsock1_Connect()
Select Case iButton
Case 1: Winsock1.SendData "admin" & vbCrLf
Case 2: Winsock1.SendData "tx power" & vbCrLf
Case 3: Winsock1.SendData "help" & vbCrLf
End Select
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox "Error occurred: " & Description
End Sub
|