我实现的方法如下 , 如果此URL站点需要 authorization 验证 , 密码错误,程序出弹出一个登陆框 , 要求重新输入密码 然后程序处于阻塞状态 . 不知道各位大侠有没有办法判断这台主机是在线 Public Function httpConnction(url As String, username As String, password As String) As Boolean
   On Error Resume Next
   Dim xmlHTTP1
   Set xmlHTTP1 = CreateObject("Microsoft.XMLHTTP")
 '  xmlHTTP1.Open "get", "http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx/getCountryCityByIp?theIpAddress=" + ip, True
   xmlHTTP1.Open "get", url, True, username, password
   xmlHTTP1.Send
   'MsgBox xmlHTTP1.ReadyState
   While xmlHTTP1.ReadyState <> 4
       'MsgBox xmlHTTP1.ReadyState
    DoEvents
   Wend
   'MsgBox xmlHTTP1.responseText
   If xmlHTTP1.responseText = Empty Or xmlHTTP1.responseText = "" Then
          httpConnction = False
   Else
         httpConnction = True
   End If
   If Err.Number > 0 Then
        httpConnction = False
   End If
   
   Set ObjXML = Nothing
End Function