怎么判断WebBrowser1网页打开失败

如何判断WebBrowser1网页打开失败?
我现在想在软件里,实现如果WebBrowser1的网站打开失败,就提示网络故障,确定后退出软件!
得如何弄啊?

听说有一个方法,是可以判断WebBrowser1里的内容是否包含我网页的中文,不是即退出。

谁有方法啊?赐教!

------解决方案--------------------
VB code

'添加 WebBrowser1, Text1

Private Sub Form_Load()
    Text1.Text = "http://xxx.xxx.xxx"
End Sub

Private Sub Command1_Click()
    WebBrowser1.Navigate Text1.Text
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    If (pDisp Is WebBrowser1.Object) Then MsgBox "网页下载完毕!"
End Sub

------解决方案--------------------
不对上面的代码是判断网页是否已下载完毕,是否正确打开需判断里面的内容的,下面的方法可能会对你有用:

1.获取WebBrowser加载网页的内容 

WebBrowser1.Document.getElementById("kw").Value = "VB编程"

WebBrowser1.Document.getElementById("f").submit '提交表单

2.往WebBrowser控件写入内容

WebBrowser1.Document.write str

3. 操作页面元素

for(i=0;i<document.getElementsByTagName.length;i++){
document.getElementsByTagName("input")[i].style.background="#CCCCCC";
}