关于InternetReadFile的问题
请问怎么用InternetReadFile把网页源代码读到一个byte数组里如下面的一段程序:
程序代码:
Option Explicit Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) 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 Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer Function GetCode(Url As String) As String Dim Hwnd1 As Long Dim Hwnd2 As Long Dim Hwnd3 As Long Dim Hwnd4 As Long Dim Str1 As String * 1024 Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000 Hwnd1 = InternetOpen("VBTagEdit", 1, vbNullString, vbNullString, 0) Hwnd2 = InternetOpenUrl(Hwnd1, Url, vbNullString, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0) If Hwnd2 <> 0 Then Do Hwnd4 = InternetReadFile(Hwnd2, Str1, 1024, Hwnd3) GetCode = GetCode & Mid$(Str1, 1, Hwnd3) Loop While (Hwnd3 <> 0) End If InternetCloseHandle (Hwnd2) End Function
返回的是string类型的。。。怎样才能返回byte类型呢?