这样写
Dim url As String = "http://www.baidu.com"
try
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim str As String = reader.ReadToEnd
stm.Dispose()
Dim reg As new System.Text.RegularExpressions.Regex("src=+.*?((.jpg)|(.png)|(.gif))")
str = reg.replace(str, "")
FileSys.WriteAllText("d:\test.htm", str, False)
catch ex As exception
msgbox(ex.Message)
End try
Dim web As System.Windows.Forms.WebBrowser = e.Form.Controls("WebBrowser1").Basecontrol
web.ScriptErrorsSuppressed = True
web.Navigate("d:\test.htm")