Exemplo n.º 1
0
        private void StartLANScanbutton_Click(object sender, EventArgs e)
        {
            LANhostslistView.Clear();
            LANScanProgresstextBox.Visible = true;
            Thread LAN_Scanning_thread = new Thread(new ThreadStart(Lan_scan));

            LAN_Scanning_thread.IsBackground = true;
            LAN_Scanning_thread.Start();
        }
Exemplo n.º 2
0
        public void Ping_Completed(object sender, PingCompletedEventArgs e)
        {
            string ip = (string)e.UserState;

            if (e.Reply != null && e.Reply.Status == IPStatus.Success)
            {
                ListViewItem item = new ListViewItem(ip);
                LANhostslistView.Invoke(new MethodInvoker(delegate()
                {
                    LANhostslistView.Items.Add(item);
                }));
            }
        }