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
福利游戏
相关文章
更多精选合集
更多大家都在玩
大家都在看
更多-
- 原神5.2版本有什么福利
- 时间:2024-11-21
-
- 无限暖暖谈幽幽最新过关技巧
- 时间:2024-11-21
-
- 伊甸之战新手少走弯路技巧总汇一览
- 时间:2024-11-21
-
- 伊甸之战卡包获得方法一览
- 时间:2024-11-21
-
- 伊甸之战战术研究馆打法技巧一览
- 时间:2024-11-21
-
- 伊甸之战肉身之转化过关攻略一览
- 时间:2024-11-21
-
- 伊甸之战战术研究馆玩法一览
- 时间:2024-11-21
-
- 伊甸之战兽族简单打法攻略一览
- 时间:2024-11-21