title: Fiddler保存Response body tags:
有趣技能
static function OnDone(oSession: Session) {
var fileName="";
var fileIndex = oSession.RequestHeaders.RequestPath.LastIndexOf ("/");
if (fileIndex > 0)
{
fileName = oSession.RequestHeaders.RequestPath.Substring (fileIndex+1);
}
if (String.IsNullOrEmpty(fileName))
{
fileName = Guid.NewGuid().ToString();
}
var saveDir="H:\\test\\";
if (!System.IO.Directory.Exists(saveDir))
{
System.IO.Directory.CreateDirectory(saveDir);
}
oSession.SaveResponseBody(saveDir + fileName);
}