Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int ipVersion = 0;

            if (listView1.SelectedItems.Count == 0)
            {
                new BalloonTip("No selection", "Select an IP session first", listView1, BalloonTip.ICON.INFO, 5000);
                return;
            }
            if (((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
            {
                ipVersion = 4;
            }
            else if (((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
            {
                ipVersion = 6;
            }
            IPEndPoint remoteEP;

            if (((IP.SocketID)listView1.SelectedItems[0].Tag).Protocol == IP.ProtocolFamily.UDP &&
                UdpDetector.Table.GetRemoteEP(((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP) != null)
            {
                remoteEP = UdpDetector.Table.GetRemoteEP(((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP);
            }
            else
            {
                remoteEP = ((IP.SocketID)listView1.SelectedItems[0].Tag).RemoteEP;
            }
            RouteIPForm form = new RouteIPForm(ipVersion, remoteEP.Address.ToString());

            form.ShowDialog();
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     int ipVersion = 0;
     if (listView1.SelectedItems.Count == 0)
     {
         new BalloonTip("No selection", "Select an IP session first", listView1, BalloonTip.ICON.INFO, 5000);
         return;
     }
     if (((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
         ipVersion = 4;
     else if (((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
         ipVersion = 6;
     IPEndPoint remoteEP;
     if (((IP.SocketID)listView1.SelectedItems[0].Tag).Protocol == IP.ProtocolFamily.UDP &&
         UdpDetector.Table.GetRemoteEP(((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP) != null)
         remoteEP = UdpDetector.Table.GetRemoteEP(((IP.SocketID)listView1.SelectedItems[0].Tag).LocalEP);
     else
         remoteEP = ((IP.SocketID)listView1.SelectedItems[0].Tag).RemoteEP;
     RouteIPForm form = new RouteIPForm(ipVersion, remoteEP.Address.ToString());
     form.ShowDialog();
 }