网页设计成品源代码-求助:用VB查看网页源代码

  Private Declare Function InternetOpen Lib \”wininet网页设计成品源代码。dll\” Alias \”InternetOpenA\” ( _

ByVal sAgent As String, ByVal lAccessType As Long, _

Private Declare Function InternetOpenUrl Lib \”wininet。
  dll\” Alias \”InternetOpenUrlA\” ( _

ByVal hInternetSession As Long, ByVal sUrl As String, _

ByVal sHeaders As String, ByVal lHeadersLength As Long, _

ByVal lFlags As Long, ByVal lContext As Long) As Long

Private Declare Function InternetReadFile Lib \”wininet。
  dll\” ( _

ByVal hFile As Long, ByVal sBuffer As String, _

ByVal lNumBytesToRead As Long, _

lNumberOfBytesRead As Long) As Integer

Public Function GetUrlFile(stUrl As String) As String

Dim lgInternet As Long, lgSession As Long

Dim stBuf As String * 1024

Dim inRes As Integer

Dim lgRet As Long

Dim stTotal As String

stTotal = vbNullString

lgSession = InternetOpen(\”VBTagEdit\”, 1, vbNullString, vbNullString, 0)

DoEvents

If lgSession Then

lgInternet = InternetOpenUrl(lgSession, stUrl, vbNullString, _

0, INTERNET_FLAG_NO_CACHE_WRITE, 0)

If lgInternet Then

Do

inRes = InternetReadFile(lgInternet, stBuf, 1024, lgRet)

stTotal = stTotal & StrConv(LeftB$(StrConv(stBuf, vbFromUnicode), lgRet), vbUnicode)

Loop While (lgRet 0)

End If

inRes = InternetCloseHandle(lgInternet)

End If

GetUrlFile = stTotal

End Function

Private Sub Command1_Click()

Text2。
  text=GetUrlFile(Text1。text)

End Sub

自己测试了一下,顺便把源码给你。

本文来自网络,不代表唯米智能立场,转载请注明出处。如有侵权请联系删除。http://www.weiseo.cc/b/2759.html

作者: 小易

上一篇
下一篇
联系我们

联系我们

在线咨询: QQ交谈

邮箱: 2013723@qq.com

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部
在线客服系统