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();
        }
    }
  • 相关阅读:
    JVM学习笔记-指向Class类的引用(A Reference to Class Class)
    JVM学习笔记-方法区示例与常量池解析(Method Area Use And Constant Pool Resolution)
    JVM学习笔记-堆(Heap)
    JVM学习笔记-程序计数器(The Program Counter)
    JVM学习笔记-栈(Stack)
    JVM学习笔记-栈帧(The Stack Frame)
    JVM学习笔记-局部变量区(Local Variables)
    html大文件传输源代码
    html大文件传输源码
    html大文件传输插件
  • 原文地址:https://www.cnblogs.com/wangchuang/p/5619865.html
Copyright © 2011-2022 走看看