Foxtable(狐表)用户栏目专家坐堂 → web浏览器选择性加载


  共有2787人关注过本帖树形打印复制链接

主题:web浏览器选择性加载

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/14 15:46:00 [显示全部帖子]

这样写

 

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")


 回到顶部