关于winsock网络编程,我是很白,急需有人帮助
小弟在用VB编一个网络获取数据的程序,用winsock控件,服务器是一个GPS的虚拟参考站,他可以自动向连接到的客户端以radio形势发送数据。
Private Sub Command1_Click()
With TCPClient
.RemoteHost = Text1.Text
.RemotePort = Text2.Text
.Connect
End With
Command1.Enabled = False
If TCPClient.State = 7 Then
Command1.Enabled = True
End If
sta = TCPClient.State
If sta Then
Text5.Text = TCPClient.State
End If
End Sub
Private Sub Command2_Click()
TCPClient.Close
Command1.Enabled = True
End Sub
Private Sub UpdClient_DataArrival(ByVal bytesTotal As Long)
Dim StrData As String
TCPClient.GetData StrData, vbString
Text5.Text = StrData
End Sub
Private Sub Form_Load()
Text1.Text = "10.10.204.149"
Text2.Text = 2001
End Sub
End Sub
小弟对网络编程很白,编了这些,接受不到数据,急向各位大侠求救。