实在是崩溃了,扔100分麻烦大家给看看~运行后抓包,发现post的header这些其它数据都出去了,但是带着的cctv=1&ID=95这个表单参数始终出不去,麻烦各位给看看~谢谢了~在线等,解决了马上给分~哎,疯掉了~~~
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        private void Form1_Load(object sender, EventArgs e)
        {
            ASCIIEncoding encoding = new ASCIIEncoding();
            string postData = "cctv=1&ID=95";            byte[] data = encoding.GetBytes(postData);            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://xxxx.com/xxxx.jsp");                myRequest.Method = "POST";
                myRequest.ServicePoint.Expect100Continue = false;
                myRequest.ContentType = "application/x-www-form-urlencoded";
                myRequest.UserAgent = "Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+TencentTraveler+4.0)";
                myRequest.Accept = "*/*";
                myRequest.Referer = "http://xxxx.com/xxxx.jsp";
                //myRequest.KeepAlive = true;
                //myRequest.Headers.Add("Accept-Language", "zh-cn");
                //myRequest.Headers.Add("Accept-Encoding", "gzip, deflate");
                //myRequest.Headers.Add("Cookie", "PHPSESSID=dc7a2c1c41d0f9c83fec012c16bc75a3");
                //myRequest.CookieContainer = cookieRequest;
                myRequest.ContentLength = data.Length;
                Stream newStream = myRequest.GetRequestStream();                // Send the data.
                newStream.Write(data,0,data.Length);
                newStream.Close();                // Get response
                HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
                StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.Default);
                string content = reader.ReadToEnd();        }
    }
}

解决方案 »

  1.   

    作为web开发,应该至少有一款使用顺手的http嗅探器,以备开发分析之用,加上ajax现在如此盛行,更加需要一个工具能分析在页面背后传输的http内容。找了几款http嗅探器,以备选用1.FiddlerFiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.http://www.fiddlertool.com/fiddler/文章推荐http://www.cnblogs.com/FrameWork/archive/2006/10/16/529835.html2.ieHTTPHeader以ie插件的形式能查看往返的HTTP Request/Response Header3.HTTPLookHTTPLook 是一个 HTTP 的嗅探器,它能捕捉本机与其它任何主机的 HTTP 通讯(不是 HTTPS 哦 ),然后显示详细的 HTTP 操作(如 GET/POST)、访问资源的 URL 、字节数大小等,这个软件简单易用,不用对 Internet Explorer 做任何其它设置(有的软件通过在 IE 中设置代理来监控数据),也不需要其它任何软件的支持,是一款较为绿色的、轻量级的软件。4.httpExplorerUsed to examine unaltered http requests and responses intercepted with and without proxy. There are several views for the data. Raw view shows the data in bytes. Text view shows the headers in the request and response as well as the http payload. The list of requests and responses are also available in two different views. One view shows the summary of the request. The other view shows the actual sends and receives performed by the browser. It is possible to search through the request urls to look for a particular url using regular expression syntax. httpExplorer works by intercepting the client/server data stream of the embeded browser. It can also work in proxy mode where the data is intercepted by emulating a proxy server. 
     查看 httpExplorer 屏幕截图 
     下载 httpExplorer 2.1 (1.42 Mb) 
    5.IEWatchIEWatch is a plug-in for Microsoft Internet Explorer that allows you to view and analyze HTTP/HTTPS headers. Furthermore you can view and analyze the HTML code directly in the browser window. 
    Unlike proxy applications IEWatch integrates directly in Internet Explorer. No more complicated configuration settings are needed to view HTTP requests. No more searching through long lists of HTTP requests to find the information you are looking for. No more switching between windows to view the HTML source code. Intuitive and easy to use, IEWatch reveals the information you are searching for. View Cookies, GET and POST data by double clicking the list item. IEWatch lets you identify which requests take the longest to complete so you can tune the performance of your web site. Knowing that security is a concern, you can check if sensitive data is sent from your browser to the server. IEWatch is the ideal tool to learn how HTTP and HTML work. The comprehensive help file accelerates the learning curve 
    IEWatch is the most essential tool for web developers and quality assurance engineers to get their job done fast and efficiently. 
    For more information, visit http://www. iewatch. com. 
     查看 IEWatch 屏幕截图 
     下载 IEWatch 2.6 (498.05 Kb) 
    6.MMD HttpHeaderMMD HttpHeader is small, absolutely free tool designed to display http headers. Just 
    type http address to get http header and connection timeout displayed in text window. 
    It's perfect for all who learn http protocol, internet programers and testers and webmasters. 下载 MMD HttpHead 1.0 (268 Kb) 
    7.HttpWatch强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出http://down.zdnet.com.cn/detail/2/19336.shtml8.Instance Source·这是一个IE浏览器插件,主要功能是实时的查看和修改 HTML 网页上的源代码, 
    当鼠标指向或选择网页的某一部分,即可在下方的窗口中快速看到网页的源代码, 
    这对网页设计相关人员还是相当有用的。推荐使用! 
    ·此版本新增显示网页颜色、显示代码行号、外部对象列表功能。 
    ·还发现了一个小秘密,它似乎能够解析加密网页的源代码。 
    http://www.skycn.com/soft/15582.html9.Page Viewer(Maxthon2 插件) + firebug(firefox 插件)这两款作为web开发辅助也是必不可少的10.sniffer sniffer pro,NAI公司出品的可能是目前最好的网络协议分析软件之一了,支持各种平台,性能优越,做为一名合格的网络管理员肯定需要有这么一套好的网络协议分析软件了
      

  2.   

    http://xxxx.com/xxxx.jsp?cctv=1&ID=95
      

  3.   

    windows 2003好像自带了一个.网络工具里边.
      

  4.   

    Page Viewer(Maxthon2 插件) + firebug(firefox 插件)
    这个不错,
    firebug做web开发更是必不可少