请问在IE中请求浏览网站时,他发出的请求的内容及格式是怎么样的??
是HttpWebRequest吗?
如果是,怎样用c#截获他?

解决方案 »

  1.   

    你直接访问HttpWebRequest就可以了,有什么截获不截获的???你要用js拦住不给发?
      

  2.   

    httpwebrequest只是封装了http的请求,不能说浏览网站是发出httpwebrequest请求
      

  3.   

    你可以用一些网络分析软件网络数据包,分析后构造httpwebrequest,但一般没必要
      

  4.   

    The HttpWebRequest class provides support for the properties and methods defined in WebRequest and for additional properties and methods that enable the user to interact directly with servers using HTTP.for example:
    using System;
    using System.Net;
    using System.IO;namespace Diyinside
    {
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Example
    {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main(string[] args)
    {
    Uri myUri =new Uri("http://www.msn.com.cn");
    WebRequest myWebRequest= WebRequest.Create(myUri);
    WebResponse myWebResponse= myWebRequest.GetResponse();
    Console.WriteLine("Object Headers :\n "+myWebResponse.Headers);
    }
    }
    }