本帖最后由 onepc 于 2013-12-19 10:20 编辑
_WinHttpSimpleReadData 这个是读数据的吗,请求过去后并把网页数据返回到我的客户端读取,但是为什么样读取是空的?
那位给个可以读数据的例子参考下》#include "WinHttp.au3"
Opt("MustDeclareVars", 1)
; 初始化并获取会话句柄
Global $hOpen = _WinHttpOpen()
; 获取连接句柄
Global $hConnect = _WinHttpConnect($hOpen, "tieba.baidu.com")
; 生成请求
Global $hRequest = _WinHttpSimpleSendRequest($hConnect,Default,"f?kw=tvb&fr=ala0")
If $hRequest Then
; 简单读取...
ConsoleWrite(StringLeft(_WinHttpSimpleReadData($hRequest),1000) & "xxxxxxxxxxxxxx" & @CRLF)
MsgBox(64, "Okey do!", "Returned source is print to concole. Check it.")
Else
MsgBox(48, "Error", "Error ocurred for _WinHttpSimpleSendRequest, Error number is " & @error)
EndIf
; 关闭句柄
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
|