本文整理汇总了C#中Fiddler.Session.WriteResponseToStream方法的典型用法代码示例。如果您正苦于以下问题:C# Session.WriteResponseToStream方法的具体用法?C# Session.WriteResponseToStream怎么用?C# Session.WriteResponseToStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fiddler.Session
的用法示例。
在下文中一共展示了Session.WriteResponseToStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SessionData
public SessionData(Session oS)
{
MemoryStream oFS = new MemoryStream();
oS.WriteRequestToStream(false, true, oFS);
this.arrRequest = oFS.ToArray();
oFS = new MemoryStream();
oS.WriteResponseToStream(oFS, false);
this.arrResponse = oFS.ToArray();
oFS = new MemoryStream();
oS.WriteMetadataToStream(oFS);
this.arrMetadata = oFS.ToArray();
oFS = new MemoryStream();
oS.WriteWebSocketMessagesToStream(oFS);
this.arrWebSocketMessages = oFS.ToArray();
}
示例2: WriteSessionToSAZ
// This is a refactored helper function which writes a single session to an open SAZ file.
internal static void WriteSessionToSAZ(Session oSession, DiskFile odfZip, int iFileNumber, string sFileNumberFormatter, StringBuilder sbHTML, bool bDisplayErrorMessages)
{
string sBaseFilename = @"raw\" + iFileNumber.ToString(sFileNumberFormatter);
string sRequestFilename = sBaseFilename + "_c.txt";
string sResponseFilename = sBaseFilename + "_s.txt";
string sMetadataFilename = sBaseFilename + "_m.xml";
// Write the Request to the Archive
try
{
ZippedFile o = new ZippedFile(odfZip, sRequestFilename);
Stream oS = o.CreateWrite(FileShare.None);
oSession.WriteRequestToStream(false, true, oS);
oS.Close();
}
catch (Exception eX)
{
if (bDisplayErrorMessages)
{
FiddlerApplication.Log.LogString("Archive Failure: Unable to add " + sRequestFilename + "\n\n" + eX.Message);
}
}
// Write the Response to the Archive
try
{
ZippedFile o = new ZippedFile(odfZip, sResponseFilename);
Stream oS = o.CreateWrite(FileShare.None);
oSession.WriteResponseToStream(oS, false);
oS.Close();
}
catch (Exception eX)
{
if (bDisplayErrorMessages)
{
FiddlerApplication.Log.LogString("Archive Failure: Unable to add " + sResponseFilename + "\n\n" + eX.Message);
}
}
// Write the MetaData to the Archive
try
{
ZippedFile o = new ZippedFile(odfZip, sMetadataFilename);
Stream oS = o.CreateWrite(FileShare.None);
oSession.WriteMetadataToStream(oS);
oS.Close();
}
catch (Exception eX)
{
if (bDisplayErrorMessages)
{
FiddlerApplication.Log.LogString("Archive Failure: Unable to add " + sMetadataFilename + "\n\n" + eX.Message);
}
}
#region AddIndexHTMLEntry
if (null != sbHTML)
{
sbHTML.Append("<tr>");
sbHTML.Append("<TD><a href='" + sRequestFilename + "'>C</a> ");
sbHTML.Append("<a href='" + sResponseFilename + "'>S</a> ");
sbHTML.Append("<a href='" + sMetadataFilename + "'>M</a></TD>");
sbHTML.Append("</tr>");
}
#endregion AddIndexHTMLEntry
}