首页 > 其他 > 详细

FiddlerCore注意事项

时间:2016-07-14 23:46:57      阅读:284      评论:0      收藏:0      [点我收藏+]

Fiddlercore 使用说明
Fiddlercore不保留session序列,因此要自己保存。并且要注意网页session不会被垃圾回收,因为oAllSessions List保持活动引用,因此要时常trim。另一种选择,若仅仅关系请求url或者请求头,只保存一个list<>而不是存储对全session的一个活动的引用

// Inside your main object, create a list to hold the sessions
// This generic list type requires your source file includes #using System.Collections.Generic.
List<Fiddler.Session> oAllSessions = new List<Fiddler.Session>();

// Inside your attached event handlers, add the session to the list:
Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS) {
Monitor.Enter(oAllSessions);
oAllSessions.Add(oS);
Monitor.Exit(oAllSessions);
};


// Call Startup to tell FiddlerCore to begin listening on the specified port,
// and optionally register as the system proxy and optionally decrypt HTTPS traffic.
Fiddler.FiddlerApplication.Startup(8877, true, true);

// Call Shutdown to tell FiddlerCore to stop listening on the specified port, and 
// unregister as the system proxy if attached.
Fiddler.FiddlerApplication.Shutdown();

 

exe.config中添加
<legacyUnhandledExceptionPolicy enabled="1"/>
能使程序回到net1.0或1.1的线程异常的状态

FiddlerCore注意事项

原文:http://www.cnblogs.com/dennysong/p/5671810.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!