level 1
服务器肯定是必须的。
给你一个简单的例子
On Error Resume Next
Dim C1 As String
C1 = GetBody("检测版本的网址")
If C1 = "" Then
MsgBox "暂时无法使用!请您稍后再试!", vbExclamation, "提示"
End
ElseIf C1 = "V1.0" Then
MsgBox "当前为最新版本", vbInformation, "提示"
Else
MsgBox "发现最新版本!", vbInformation, "提示"
Shell "explorer.exe 网址"
End
End If
2014年03月03日 22点03分
2
level 1
'##################################################################
'## 函数名称:GetBody
'## 参数:ByVal 为$型
''## 返回类型: 不确定
'##################################################################
Public Function GetBody(ByVal URL$)
Dim XML_HTTP
Set XML_HTTP = CreateObject("Microsoft.XMLHTTP")
XML_HTTP.Open "get", URL, True
XML_HTTP.setRequestHeader "If-Modified-Since", "0" ' 刷新获取
XML_HTTP.send
While XML_HTTP.ReadyState <> 4
DoEvents
Wend
GetBody = XML_HTTP.responseText
Set XML_HTTP = Nothing
End Function
2014年03月03日 22点03分
3