当前位置: 首页>>代码示例>>C#>>正文


C# Session.WriteResponseToStream方法代码示例

本文整理汇总了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();
 }
开发者ID:pisceanfoot,项目名称:socketproxy,代码行数:15,代码来源:SessionData.cs

示例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>&nbsp;");
                sbHTML.Append("<a href='" + sResponseFilename + "'>S</a>&nbsp;");
                sbHTML.Append("<a href='" + sMetadataFilename + "'>M</a></TD>");
                sbHTML.Append("</tr>");
            }
#endregion AddIndexHTMLEntry
        }
开发者ID:LeePaulSmith,项目名称:gocardless-dotnet,代码行数:67,代码来源:SAZ-XCEEDZIP.cs


注:本文中的Fiddler.Session.WriteResponseToStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。