vb.net怎样在后台点击一按钮,前台弹窗软件立即弹出
后台操作时JAVA写的,前台是个弹窗软件,怎样在后台点击一按钮,前台弹窗软件立即弹出
下面的代码是我用Timer做的,但是Timer得一直访问,这样的话,如果客户端多的话,服务器会很慢,如果不设成一直访问,就产生不出“立即弹出”的效果了。求解~~
Public Function Now() As Boolean
Dim xmlDoc As XmlDocument
Dim xe As XmlElement
'从服务器获取媒体相关信息
Try
Dim webRequest As HttpWebRequest = Net.WebRequest.Create("http://192.168.0.244:8080/sv/PopupServlet.s")
Dim webResponse As HttpWebResponse = webRequest.GetResponse()
Dim resiveStream As Stream = webResponse.GetResponseStream()
Dim read As StreamReader = New StreamReader(resiveStream, System.Text.Encoding.UTF8)
Dim stringRead As String = read.ReadToEnd()
read.Close()
resiveStream.Close()
webResponse.Close()
xmlDoc = New XmlDocument()
xmlDoc.LoadXml(stringRead)
Dim nodeList As XmlNodeList = xmlDoc.SelectSingleNode("exercise").ChildNodes '获取mPortal节点的所有子节点
Dim xn As XmlNode
For Each xn In nodeList '遍历所有子节点
xe = CType(xn, XmlElement) '将子节点类型转换为XmlElement类型
If xe.Name = "media" Then
'取值
_Md5 = xe.GetAttribute("setOrNot") '取MD5值
End If
Next xn
Return True
Catch ex As Exception
Return False
End Try
End Function
'立即弹出
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Now() = True Then
If Md51 <> "" Then
If _Md5 <> Md51 Then
Me.Show()
End If
End If
End If
Md51 = _Md5
End Sub
--------------------编程问答-------------------- 服务器和客户端在响应发送完毕后是断开的,服务器上不可能知道往哪个客户端发送的
--------------------编程问答-------------------- 一语击破.. --------------------编程问答-------------------- 服务器和客户端响发送完毕之后,怎么样再次让服务器与客户端响应? --------------------编程问答--------------------
服务器和客户端响发送完毕之后,怎么样再次让服务器与客户端响应?
补充:.NET技术 , VB.NET