Ejemplo n.º 1
0
        public static void processOutput(String output)
        {
            String[] lines = output.Split('\r');

            foreach (String s in lines)
            {
                if (s.Contains("TCP") && !s.Contains("127.0.0.1"))
                {
                    try
                    {
                        String cleaned = RemoveWhitespace(s);
                        String remote  = cleaned.Split(' ')[3].Split(':')[0];
                        String pid     = cleaned.Split(' ')[5];
                        //Console.WriteLine(remote + " : " + pid);
                        foreach (IPRecord rec in TCPConnectionManager.getList())
                        {
                            if (rec.remote_ip == remote)
                            {
                                rec.pid     = pid;
                                rec.program = Process.GetProcessById(int.Parse(rec.pid)).ProcessName;
                                break;
                            }
                        }
                    }
                    catch (Exception e) { }
                }
            }
        }
Ejemplo n.º 2
0
 private void dispatcherTimer_Tick(object sender, EventArgs e)
 {
     connectListBox.Items.Clear();
     map_img.Children.Clear();
     foreach (IPRecord c in TCPConnectionManager.ShowActiveTcpConnections())
     {
         if (!c.remote_ip.Contains(local_ip.Substring(0, 10)))
         {
             connectListBox.Items.Add(c.program + ": " + c.RemoteEndPoint);
             map_refresh(28.5383, -81.3792, c);
         }
     }
 }
Ejemplo n.º 3
0
        private void connectListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                IPRecord rec = TCPConnectionManager.getList()[connectListBox.SelectedIndex];
                if (prev_selected != null)
                {
                    prev_selected.isSelected = false;
                }
                rec.isSelected = true;

                map_refresh(28.5383, -81.3792, rec);
                popmenu.update(rec);
                prev_selected = rec;
            }
            catch (Exception ne) { }
        }