[Visual Basic] syntaxhighlighter_viewsource syntaxhighlighter_copycode
Dim gzip() As Byte
On Error GoTo ErrHandle '错误处理
Dim ShuJu As String
Dim cwj As String
Dim neirong As String
Dim nr As String
Dim nt As String
Dim aaa As String
aaa = CStr(WebBrowser1.Document.Cookie)
aaa = Replace(Mid(aaa, InStr(aaa, "skey="), InStr(InStr(aaa, "skey="), aaa, ";") - InStr(aaa, "skey=")), "skey=", "")
Dim WinHttp As WinHttp.WinHttpRequest '声明一个对象
Set WinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
ShuJu = "gc=" & Text1.Text & "&st=0&end=20000&sort=0&bkn=" & g_tk10位版(aaa) '设置POST数据
WinHttp.Open "POST", "http://qun.qq.com/cgi-bin/qun_mgr/search_group_members", True
WinHttp.SetTimeouts 30000, 30000, 30000, 30000 '设置超时时间
WinHttp.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300 '忽略错误
WinHttp.SetRequestHeader "Accept", "application/json, text/javascript, */*; q=0.01"
WinHttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
WinHttp.SetRequestHeader "X-Requested-With", "XMLHttpReques"
WinHttp.SetRequestHeader "Referer", "http://qun.qq.com/member.html?#gid=" & Text1.Text
WinHttp.SetRequestHeader "Accept-Language", "zh-cn"
WinHttp.SetRequestHeader "Accept-Encoding", "gzip, deflate"
WinHttp.SetRequestHeader "User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
WinHttp.SetRequestHeader "Host", "qun.qq.com"
WinHttp.SetRequestHeader "Content-Length", "46"
WinHttp.SetRequestHeader "Connection", "keep-alive"
WinHttp.SetRequestHeader "Cache-Control", "no-cache"
WinHttp.SetRequestHeader "Cookie", WebBrowser1.Document.Cookie
WinHttp.Send ShuJu '发送
WinHttp.WaitForResponse '异步发送
gzip = WinHttp.ResponseBody '获取返回的byte
UnCompressByte gzip 'gzip 解压缩
nr = BytesToBstr(gzip, "UTF-8")