Ejemplo n.º 1
0
        private void buttonSearchServices_Click(object sender, EventArgs e)
        {
            if (!(NetworkingToolkit.ValidateIPAddress(ip) && NetworkingToolkit.ValidatePort(port)))
            {
                configurarToolStripMenuItem.PerformClick();
            }

            listViewPCs.Items.Clear();

            connection.ServerIP   = ip;
            connection.ServerPort = port;
            try
            {
                foreach (var pc in connection.GetPlayers())
                {
                    ListViewItem temp = new ListViewItem(pc.IP.ToString());
                    temp.SubItems.Add(pc.Name);
                    temp.SubItems.Add((pc.Displays as List <WCFScreenInformation>).Count.ToString());

                    temp.Tag = pc;

                    listViewPCs.Items.Add(temp);
                }
            }
            catch
            {
            }
        }