Fiddlercore Demo - Fiddler

Posted HOT SUMMER

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fiddlercore Demo - Fiddler相关的知识,希望对你有一定的参考价值。

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();
    }
}

 

以上是关于Fiddlercore Demo - Fiddler的主要内容,如果未能解决你的问题,请参考以下文章

fiddlercore 抓包获取cookie的方法

c#FiddlerCore AutoResponder隧道连接失败

浣跨敤 FiddlerCore 鑷畾涔?HTTP/HTTPS 缃戠粶浠g悊

FiddlerCoreAPI开发源码分析

ExtJs学习笔记

请建议 Fiddler Core 3rd 方库的替代方案