Exemplo n.º 1
0
        private void myFreeHttpWindow_OnGetSessionRawData(object sender, FreeHttpWindow.GetSessionRawDataEventArgs e)
        {
            Session tempSession = Fiddler.FiddlerObject.UI.GetFirstSelectedSession();

            if (tempSession == null)
            {
                Fiddler.FiddlerObject.UI.ShowAlert(new frmAlert("STOP", "please select a session", "OK"));
                FreeHttpWindow.MarkWarnControl(Fiddler.FiddlerApplication.UI.lvSessions);
                return;
            }
            switch (e.SessionAction)
            {
            case FreeHttpWindow.GetSessionAction.ShowShowResponse:
                string tempStr = FiddlerSessionTamper.GetSessionRawData(tempSession, true);
                ShowMes(tempStr == null ? "error session" : string.Format("Get Raw Data\r\n{0}", tempStr));
                myFreeHttpWindow.ShowOwnerWindow(tempSession.fullUrl, tempStr);
                break;

            case FreeHttpWindow.GetSessionAction.SetCookies:
                myFreeHttpWindow.SetClientAddCookies(tempSession.RequestHeaders["Cookie"]);
                break;

            case FreeHttpWindow.GetSessionAction.DeleteCookies:
                myFreeHttpWindow.SetClientDelCookies(tempSession.RequestHeaders["Cookie"]);
                break;

            default:
                Fiddler.FiddlerObject.UI.ShowAlert(new frmAlert("STOP", "Not supported this SessionAction", "OK"));
                break;
            }
        }
Exemplo n.º 2
0
        void myFreeHttpWindow_OnGetSessionRawData(object sender, FreeHttpWindow.GetSessionRawDataEventArgs e)
        {
            Session tempSession = Fiddler.FiddlerObject.UI.GetFirstSelectedSession();

            if (tempSession != null)
            {
                if (e.IsGetCookies)
                {
                    myFreeHttpWindow.SetClientCookies(tempSession.RequestHeaders["Cookie"]);
                }
                else
                {
                    string tempStr = FiddlerSessionTamper.GetSessionRawData(tempSession, e.IsShowResponse);
                    ShowMes(tempStr == null ? "error session" : string.Format("Get Raw Data\r\n{0}", tempStr));
                    myFreeHttpWindow.ShowOwnerWindow(tempSession.fullUrl, tempStr);
                }
            }
            else
            {
                Fiddler.FiddlerObject.UI.ShowAlert(new frmAlert("STOP", "please select a session", "OK"));
                //((FreeHttpWindow)sender).MarkWarnControl(Fiddler.FiddlerApplication.UI.lvSessions);
                FreeHttpWindow.MarkWarnControl(Fiddler.FiddlerApplication.UI.lvSessions);
            }
        }