Private Type SystemInfo
typename As Long
versionNum As Byte
sequence As Long
url_len As Integer
url As String
cooks_len As Integer
cooks As String
uid As String * 2
End Type
Private Sub Command1_Click()
Dim b() As Byte
Dim sendmsg As SystemInfo
sendmsg.typename = &H41345523
sendmsg.versionNum = &H4
sendmsg.sequence = "9"
sendmsg.url_len = Len(sendmsg.url)
sendmsg.url = "http://www.fjbn.cn"
sendmsg.uid = Space(16)
sendmsg.cooks_len = Len(sendmsg.cooks)
sendmsg.cooks = "MeNane=fjbm||;SPEC="
ReDim b(Len(sendmsg)) As Byte
CopyMemory b(0), sendmsg, Len(sendmsg)
winsock1.SendData b()
MsgBox ("OK")
End Sub
Private Sub Form_Load()
With winsock1
.RemoteHost = "32.153.124.210" '要连接到的计算机名
.RemotePort = 80 '要连接到的端口号
.LocalPort = 80 '该Winsock控制将要使用的本地端口号,便于其它端与该Winsock通讯
.Bind 80 '将该Winsock控制绑定到该本地端口
End With
End Sub大家帮我看下,我哪里写错了
为什么服务端不能接收到数据
typename As Long
versionNum As Byte
sequence As Long
url_len As Integer
url As String
cooks_len As Integer
cooks As String
uid As String * 2
End Type
Private Sub Command1_Click()
Dim b() As Byte
Dim sendmsg As SystemInfo
sendmsg.typename = &H41345523
sendmsg.versionNum = &H4
sendmsg.sequence = "9"
sendmsg.url_len = Len(sendmsg.url)
sendmsg.url = "http://www.fjbn.cn"
sendmsg.uid = Space(16)
sendmsg.cooks_len = Len(sendmsg.cooks)
sendmsg.cooks = "MeNane=fjbm||;SPEC="
ReDim b(Len(sendmsg)) As Byte
CopyMemory b(0), sendmsg, Len(sendmsg)
winsock1.SendData b()
MsgBox ("OK")
End Sub
Private Sub Form_Load()
With winsock1
.RemoteHost = "32.153.124.210" '要连接到的计算机名
.RemotePort = 80 '要连接到的端口号
.LocalPort = 80 '该Winsock控制将要使用的本地端口号,便于其它端与该Winsock通讯
.Bind 80 '将该Winsock控制绑定到该本地端口
End With
End Sub大家帮我看下,我哪里写错了
为什么服务端不能接收到数据
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)