为什么在VB.NET 中的AxWinsock1.SendData(TextBox2.Text)和AxWinsock1.GetData(strData)发送和接收都会出现错误的?
源码如下:
接收:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
AxWinsock1.SendData(TextBox2.Text)
Catch OE As System.Runtime.InteropServices.COMException
End Try
End Sub
发送:
Private Sub AxWinsock1_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles AxWinsock1.DataArrival
Dim strData As Object
AxWinsock1.GetData(strData)
TextBox1.Text = strData
End Sub
[此贴子已经被作者于2007-8-14 17:02:05编辑过]