Beispiel #1
0
        void BtnGetSystemsClick(object sender, EventArgs e)
        {
            //Get systems with the specified tag
            try {
                if (cboTags.Text != "" & this.mcafeeApi != null)
                {
                    List <Machine> systems = mcafeeApi.GetTaggedSystems(cboTags.Text);


                    foreach (Machine sys in systems)
                    {
                        if (rtbSystems.Text == "")
                        {
                            rtbSystems.Text = sys.Name;
                        }
                        else
                        {
                            rtbSystems.Text += "\n" + sys.Name;
                        }
                    }
                    MessageBox.Show(string.Format("{0} tagged machine(s) retrieved.", systems.Count), "Retrieved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }