#include-Once
#include <WinINet.au3>
MsgBox(0, '', _WinINetEX_GetSource('http://www.a.com/'))
Func _WinINetEX_GetSource($s_URL)
Local $__URL_INFO = _WinINet_InternetCrackUrl($s_URL), $i = 1
Local $_SOURCE = Binary("")
Local $iStartup = _WinINet_Startup()
$hInternetOpen = _WinINet_InternetOpen("Mozilla/5.0 Firefox/3.0.1", $INTERNET_OPEN_TYPE_DIRECT, 0, Default, Default)
$hInternetConnect = _WinINet_InternetConnect($hInternetOpen, $INTERNET_SERVICE_HTTP, $__URL_INFO[4], 0, 0, Default, Default, 0)
$hHttpOpenRequest = _WinINet_HttpOpenRequest($hInternetConnect, "GET", $__URL_INFO[6] & $__URL_INFO[7], $INTERNET_FLAG_RELOAD, "HTTP/1.1", Default, Default, 0)
$hHttpSendRequest = _WinINet_HttpSendRequest($hHttpOpenRequest, Default, Default)
Do
$_SOURCE &= _WinINet_InternetReadFile($hHttpOpenRequest, 6000)
Until @error <> 0 Or Not @extended
Return BinaryToString($_SOURCE, 1)
EndFunc ;==>_WinINetEX_GetSource
网上好像是说WININET的BUG无法设置TIMEOUT
碰碰运气看看有人知道不! |