我用软件取到的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=e1e4c2081919ede12be1fcb898c42adcca04a71d643caba81b638bfc14957334d23981ad310fb02c4b892dc150c32bb2UIN=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不了啊。