下面是直接输入地址之后对应的获取网页源码的代码:
Dim url As String = "http://toutiao.com/m6051259851/"
try
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
rqst.TimeOut = 1000 '一秒
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()
Output.Show(str)
catch ex As exception
msgbox(ex.Message)
End try
现在怎么变通实现获取窗体中Web浏览器已经打开的网页的源码呢?