CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VB >  控件

Winsock怎么发送POST啊

楼主xiamms()2006-12-04 18:10:06 在 VB / 控件 提问

我用软件取到的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

相关问题

关键词

得分解答快速导航

  • 帖主:xiamms

相关链接

  • Visual Basic类图书
  • Visual Basic类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo