3、服务器端得到信息以后,可以判断出唯一,不需要什么切换啊。
这块怎么判断那一账套的数据库的表呢
例如
、在服务器端项目的全局代码中,加入如下代码:
Public tbrk As new Dictionary(of
String,String)
2、在服务端项目的OpenQQ服务端的ReceivedMessage事件加上代码:
Dim
msg As String = e.Message
If msg.StartsWith("?#")
AndAlso msg.EndsWith("#?") Then '收到请求编辑信号
Dim
Key As String = msg.SubString(2,msg.Length - 4)
If tbrk.Containskey(Key) =
False Then
'如果无人编辑此行
tbrk.Add(Key,e.UserName)
'登记申请者为此行的编辑者
e.ReturnValue = "OK"
'通知申请者可以编辑
ElseIf tbrk(Key) = e.UserName Then '如果申请者就是之前登记的编辑者
e.ReturnValue = "OK"
'通知申请者可以编辑
Else '如果之前登记的编辑者为其他人
e.ReturnValue = tbrk(Key) & "正在编辑此行!" '告知申请者是谁在编辑此行
End If
ElseIf msg.StartsWith("!#")
AndAlso msg.EndsWith("#!") Then
'收到结束编辑信号
Dim Key As String = msg.SubString(2,msg.Length - 4)
If tbrk.Containskey(Key)
Then
tbrk.Remove(Key) '从集合中移除此行的编辑登记
End If
End
If