vb2010获取网页源码的函数
时间:2014-07-24 | 作者:本站整理 | 阅读:829vb2010获取网页源码的函数如下:
Function posthtml(ByVal _URL As String) As String
Dim TitelStart, TitelEnd As Short
Dim TitelTxt As String
Dim url As String = _URL ' 网页地址
Dim httpReq As System.Net.HttpWebRequest
Dim httpResp As System.Net.HttpWebResponse
Dim httpURL As New System.Uri(url)
httpReq = CType(Net.HttpWebRequest.Create(httpURL), Net.HttpWebRequest)
httpReq.Method = "GET"
httpResp = CType(httpReq.GetResponse(), Net.HttpWebResponse)
Dim reader As IO.StreamReader = New IO.StreamReader(httpResp.GetResponseStream)
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码
TitelStart = respHTML.IndexOf("<title>") + 7
TitelEnd = respHTML.IndexOf("</title>")
TitelTxt = respHTML.Substring(TitelStart, TitelEnd - TitelStart)
Return TitelTxt.Trim
End Function
福利游戏
相关文章
更多大家都在玩
大家都在看
更多-
- 币圈交易平台:高风险高收益的未来展望
- 时间:2025-07-05
-
- 小米米家空调夏测正式启动:硬抗新疆吐鲁番48℃高温
- 时间:2025-07-05
-
- 薄饼交易所K线图查看指南
- 时间:2025-07-05
-
- 数学题干带猫AI就不会了!错误率翻3倍 DeepSeek、o1都不能幸免
- 时间:2025-07-05
-
- GEC环保币跌至200:影响与应对策略
- 时间:2025-07-05
-
- 助力国足崛起!中国足协:超2.5万人注册足协球员自荐系统
- 时间:2025-07-05
-
- 人类潜入恐龙禁地 侏罗纪世界:重生总票房破2亿
- 时间:2025-07-05
-
- Toncoin发行价格
- 时间:2025-07-05