Ejemplo n.º 1
0
        private void LoadVirtualMachines()
        {
            string strHost   = string.Empty;
            string strSystem = string.Empty;

            comboVMs.Items.Clear();
            lstVMs.Clear();

            strHost = objXen.GetFirstVirtualMachine();


            while (objXen.LastError == 0)
            {
                lstVMs.Add(strHost);
                strSystem = objXen.GetOperatingSystem(strHost);

                if (strSystem.Length != 0L)
                {
                    strHost = string.Format("{0} - {1}", strHost, strSystem);
                }

                comboVMs.Items.Add(strHost);

                strHost = objXen.GetNextVirtualMachine();
            }

            comboVMs.SelectedIndex = 0;
        }