Winsock怎么发送POST啊
我用软件取到的HTTP头信息如下:
POST /cgi-bin/asubmit HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*
Referer: http://activate.qq.com/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: activate.qq.com
Content-Length: 51
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: pvid=1515314268; time=1165131940; depth=1; minitime=0; randomSeed=7429908; edition=3m8.mail.qq.com; notS=1; activatesession=e1e4c2081919ede12be1fcb898c42adcca04a71d643caba81b638bfc14957334d23981ad310fb02c4b892dc150c32bb2
UIN=123456&VERIFY=%B5%C4%BE%DD%B8%A1%BF%C9&skip=1
我写的代码如下:
Private Sub Command1_Click()
Winsock1.RemoteHost = "activate.qq.com"
Winsock1.RemotePort = 80
End Sub
Private Sub Winsock1_Connect()
On Error Resume Next
Dim strCommand As String
Dim strWebPage As String
strWebPage = "/cgi-bin/asubmit"
strCommand = "POST " + strWebPage + " HTTP/1.0" + vbCrLf
strCommand = strCommand + "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*" + vbCrLf
strCommand = strCommand + "Referer: http://activate.qq.com/" + vbCrLf
strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
strCommand = strCommand + "Content-Type: application/x-www-form-urlencoded" + vbCrLf
strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
strCommand = strCommand + "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" + vbCrLf
strCommand = strCommand + "Host: activate.qq.com" + vbCrLf
strCommand = strCommand + "Content-Length: 51" + vbCrLf
strCommand = strCommand + "Connection: Keep-Alive" + vbCrLf
strCommand = strCommand + "Cache-Control: no-cache" + vbCrLf
strCommand = strCommand + "Cookie: pvid=1515314268; time=1165131940; depth=1; minitime=0; randomSeed=7429908; edition=3m8.mail.qq.com; notS=1; activatesession=e1e4c2081919ede12be1fcb898c42adcca04a71d643caba81b638bfc14957334d23981ad310fb02c4b892dc150c32bb2" + vbCrLf
strCommand = strCommand + vbCrLf
strCommand = strCommand + "UIN=123456&VERIFY=%B5%C4%BE%DD%B8%A1%BF%C9&skip=1"
Winsock1.SendData strCommand
End Sub
大家帮我检查一下,我写的代码是否正确。为什么POST不了啊。
问题点数:100、回复次数:3Top
1 楼Dunzip(路登软件,一路登先 / http://www.dunzip.com)回复于 2006-12-04 19:01:29 得分 0
不是POST不了,而是服務器根本不會響應.原因是服務器有審核機制.
Top
2 楼Modest(塞北雪貂)·(偶最欣赏楼主的分)回复于 2006-12-04 19:16:43 得分 0
用msxml吧Top
3 楼xiamms()回复于 2006-12-05 21:22:38 得分 0
msxml
好像发送不了CookieTop




