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();
        }
    }
  • 相关阅读:
    linux advancing program signal [copy]
    advacing lnux program zombie process [copy]
    Devpress.XtraGrid.GridControl 笔记(转载)
    嵌入别的程序到winform(C#)
    GridControl控件使用小结
    .net 时间类型的一小bug ToShortDateString()
    gridControl repositoryItemLookUpEdit控件使用
    .net架构的最后思考(箴言)
    VS项目引用,无法更新
    关于ZendOptimizer和wamp的phpmyadmin冲突问题
  • 原文地址:https://www.cnblogs.com/wangchuang/p/5619865.html
Copyright © 2011-2022 走看看