客户端向服务器端发送一个string类型字符串时
str = "yidong" & "," & CStr(x1) & "," & CStr(X2)
服务器收到后做怎样的处理才能得到字符串"yidong"和整形变量 x,y
也就是怎么样将上面的函数分开
不知道用什么函数?
vb又没有指针,不知道怎么样实现
请指点
谢谢
我做的是基于web的地理信息系统
实现图片拖动后,服务器把处理后的图片发过来
客户端
Public x1 As Long
Public y1 As Long
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
x1 = X
y1 = Y
End Sub
Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
x1 = X - x1
y1 = Y - y1
End Sub
Private Sub yidong_Click()
Dim str As String
Sleep 1000 //等待 x1,y1赋值
str = "yidong" & "," & CStr(x1) & "," & CStr(X2)
wskb.SendData str
End Sub
服务器端
Dim str As String
Dim X As Long
Dim Y As Long
Wska.GetData str
strb = Split(str, ",")
If strb(0) Like "yidong" Then
str = strb(0)
X = CLng(strb(1))
Y = CLng(strb(2)) '这块提示类型不匹配
Map1.CenterX = Map1.CenterX + X
Map1.CenterY = Map1.CenterY + Y
end if
大家帮忙看一下 错误在哪儿?