예제 #1
0
 private void DoDiffBtn_Click(object sender, EventArgs e)
 {
     if (SelectedRowsCount == 2)
     {
         int ALogId = -1;
         int BLogId = -1;
         foreach (DataGridViewRow Row in LogGrid.Rows)
         {
             if ((bool)Row.Cells[0].Value)
             {
                 if (ALogId == -1)
                 {
                     ALogId = (int)Row.Cells[1].Value;
                 }
                 else if (BLogId == -1)
                 {
                     BLogId = (int)Row.Cells[1].Value;
                     break;
                 }
             }
         }
         SessionsDiffer Sdiff = new SessionsDiffer();
         Sdiff.SetSessions(this.CurrentSearchSource, ALogId, BLogId);
         Sdiff.Show();
     }
     else
     {
         MessageBox.Show(string.Format("Diff can be done only when two sessions are selected. You have selected {0} sessions", SelectedRowsCount), "Selection Error");
     }
 }
예제 #2
0
 private void DoDiffBtn_Click(object sender, EventArgs e)
 {
     if (SelectedRowsCount == 2)
     {
         int ALogId = -1;
         int BLogId = -1;
         foreach (DataGridViewRow Row in ScanTraceOverviewGrid.Rows)
         {
             if ((bool)Row.Cells[0].Value)
             {
                 if (ALogId == -1)
                 {
                     try
                     {
                         ALogId = Int32.Parse(Row.Cells[2].Value.ToString());
                     }
                     catch { }
                 }
                 else if (BLogId == -1)
                 {
                     try
                     {
                         BLogId = Int32.Parse(Row.Cells[2].Value.ToString());
                     }
                     catch { }
                     break;
                 }
             }
         }
         SessionsDiffer Sdiff = new SessionsDiffer();
         Sdiff.SetSessions("Scan", ALogId, BLogId);
         Sdiff.Show();
     }
     else
     {
         MessageBox.Show(string.Format("Diff can be done only when two sessions are selected. You have selected {0} sessions", SelectedRowsCount), "Selection Error");
     }
 }
예제 #3
0
 private void DoDiffBtn_Click(object sender, EventArgs e)
 {
     if (SelectedRowsCount == 2)
     {
         int ALogId = -1;
         int BLogId = -1;
         foreach (DataGridViewRow Row in ScanTraceOverviewGrid.Rows)
         {
             if ((bool)Row.Cells[0].Value)
             {
                 if (ALogId == -1)
                 {
                     try
                     {
                         ALogId = Int32.Parse(Row.Cells[2].Value.ToString());
                     }
                     catch { }
                 }
                 else if (BLogId == -1)
                 {
                     try
                     {
                         BLogId = Int32.Parse(Row.Cells[2].Value.ToString());
                     }
                     catch { }
                     break;
                 }
             }
         }
         SessionsDiffer Sdiff = new SessionsDiffer();
         Sdiff.SetSessions("Scan", ALogId, BLogId);
         Sdiff.Show();
     }
     else
     {
         MessageBox.Show(string.Format("Diff can be done only when two sessions are selected. You have selected {0} sessions", SelectedRowsCount), "Selection Error");
     }
 }
예제 #4
0
파일: Main.cs 프로젝트: herotheo/IronWASP
        private void DoDiffBtn_Click(object sender, EventArgs e)
        {
            List<int> TriggerIds = new List<int>();
            TriggerIds = new List<int>(Finding.TriggersSelectedForDiff);

            if (TriggerIds.Count == 2)
            {
                SessionsDiffer SD = new SessionsDiffer();
                Trigger A;
                Trigger B;
                if (TriggerIds[0] == 0)
                {
                    A = new Trigger("", Finding.CurrentPluginResult.BaseRequest, "", Finding.CurrentPluginResult.BaseResponse);
                }
                else
                {
                    A = Finding.CurrentPluginResult.Triggers.GetTrigger(TriggerIds[0] - 1);
                }
                if (TriggerIds[1] == 0)
                {
                    B = new Trigger("", Finding.CurrentPluginResult.BaseRequest, "", Finding.CurrentPluginResult.BaseResponse);
                }
                else
                {
                    B = Finding.CurrentPluginResult.Triggers.GetTrigger(TriggerIds[1] - 1);
                }

                Session First = null;
                Session Second = null;
                if (A.Response == null)
                {
                    First = new Session(A.Request);
                }
                else
                {
                    First = new Session(A.Request, A.Response);
                }
                if (B.Response == null)
                {
                    Second = new Session(B.Request);
                }
                else
                {
                    Second = new Session(B.Request, B.Response);
                }
                SD.SetSessions(First, Second);
                SD.Show();
            }
            else
            {
                if (TriggerIds.Count == 0)
                {
                    MessageBox.Show("Select two items before doing a Diff. You have NOT selected any items currently");
                }
                else if (TriggerIds.Count == 1)
                {
                    MessageBox.Show("Select two items before doing a Diff. You have selected only one item currently");
                }
                else if (TriggerIds.Count > 2)
                {
                    MessageBox.Show("Select two items before doing a Diff. You have selected more than two items currently");
                }
            }
        }
예제 #5
0
 private void DoDiffBtn_Click(object sender, EventArgs e)
 {
     if (SelectedRowsCount == 2)
     {
         int ALogId = -1;
         int BLogId = -1;
         foreach (DataGridViewRow Row in LogGrid.Rows)
         {
             if ((bool)Row.Cells[0].Value)
             {
                 if (ALogId == -1)
                 {
                     ALogId = (int)Row.Cells[1].Value;
                 }
                 else if (BLogId == -1)
                 {
                     BLogId = (int)Row.Cells[1].Value;
                     break;
                 }
             }
         }
         SessionsDiffer Sdiff = new SessionsDiffer();
         Sdiff.SetSessions(this.CurrentSearchSource, ALogId, BLogId);
         Sdiff.Show();
     }
     else
     {
         MessageBox.Show(string.Format("Diff can be done only when two sessions are selected. You have selected {0} sessions", SelectedRowsCount), "Selection Error");
     }
 }