コード例 #1
0
        private void 捕获包统计ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable();

            for (int i = 0; i < listViewMain.Items.Count; i++)
            {
                string tmpProtocal = listViewMain.Items[i].SubItems[4].Text;
                if (!ht.ContainsKey(tmpProtocal))
                {
                    ht.Add(tmpProtocal, 1);
                }
                else
                {
                    int count = (int)ht[tmpProtocal];
                    count++;
                    ht[tmpProtocal] = count;
                }
            }
            //HashTalbe转换为数组
            packetKind[] result     = new packetKind[ht.Count];
            int          arrayIndex = 0;

            foreach (Object obj in ht.Keys)
            {
                result[arrayIndex].protocol = obj.ToString();
                result[arrayIndex].count    = (int)ht[obj];
                arrayIndex++;
            }
            statisticForm frm = new statisticForm(result);

            frm.Show();
        }
コード例 #2
0
ファイル: mainForm.cs プロジェクト: shapowang/SharpShark
 private void 网络状况统计ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     statisticForm frm = new statisticForm();
     frm.Show();
 }
コード例 #3
0
ファイル: mainForm.cs プロジェクト: shapowang/SharpShark
 private void 捕获包统计ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Hashtable ht = new Hashtable();
     for (int i = 0; i < listViewMain.Items.Count; i++)
     {
         string tmpProtocal = listViewMain.Items[i].SubItems[4].Text;
         if (!ht.ContainsKey(tmpProtocal))
         {
             ht.Add(tmpProtocal, 1);
         }
         else
         {
             int count = (int)ht[tmpProtocal];
             count++;
             ht[tmpProtocal] = count;
         }
     }
     //HashTalbe转换为数组
     packetKind[] result = new packetKind[ht.Count];
     int arrayIndex = 0;
     foreach (Object obj in ht.Keys)
     {
         result[arrayIndex].protocol = obj.ToString();
         result[arrayIndex].count = (int)ht[obj];
         arrayIndex++;
     }
     statisticForm frm = new statisticForm(result);
     frm.Show();
 }
コード例 #4
0
        private void 网络状况统计ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statisticForm frm = new statisticForm();

            frm.Show();
        }