zoukankan      html  css  js  c++  java
  • Fiddlercore Demo

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Fiddler.FiddlerApplication.OnNotification += FiddlerApplication_OnNotification;
            Fiddler.FiddlerApplication.Log.OnLogString += Log_OnLogString;
            Fiddler.FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
            Fiddler.FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse;
            Fiddler.FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
            Fiddler.CONFIG.IgnoreServerCertErrors = false;
        }
     
        void FiddlerApplication_AfterSessionComplete(Fiddler.Session oSession)
        {
            Console.WriteLine("Finished session:t" + oSession.fullUrl);
        }
     
        void FiddlerApplication_BeforeResponse(Fiddler.Session oSession)
        {
            Debug.WriteLine("{0}:HTTP {1} for {2}", oSession.id, oSession.responseCode, oSession.fullUrl);
        }
     
        void FiddlerApplication_BeforeRequest(Fiddler.Session oSession)
        {
            Debug.WriteLine("Before request for:t" + oSession.fullUrl);
            oSession.bBufferResponse = true;
        }
     
        void FiddlerApplication_OnNotification(object sender, Fiddler.NotificationEventArgs e)
        {
            Debug.WriteLine("** NotifyUser: " + e.NotifyString);
        }
        void Log_OnLogString(object sender, Fiddler.LogEventArgs e)
        {
            Debug.WriteLine("** LogString: " + e.LogString);
        }
     
        /// <summary>
        /// キャプチャ開始
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            Fiddler.FiddlerApplication.Startup(8877, true, true);
     
        }
     
        /// <summary>
        /// キャプチャ終了
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Shutting down...");
            Fiddler.FiddlerApplication.Shutdown();
        }
    }
  • 相关阅读:
    和大家分享下我的找工作历程。
    Traits 编程技法+模板偏特化+template参数推导+内嵌型别编程技巧
    SGI STL空间配置器和内存池
    调试Release版本应用程序
    HawkNL 源码剖析
    C++:float 转型到 std::string 之总结。
    将一个数上调至2^n的倍数《参考STL源码》
    JavaScript中Ajax的使用
    jQuery之noConflict() 方法
    Linq to Object 的简单使用示例
  • 原文地址:https://www.cnblogs.com/wangchuang/p/5619865.html
Copyright © 2011-2022 走看看