Пример #1
0
        private void Get_Data_Hardware_WMI()
        {
            string[] Query_Select = new string[5];
            Query_Select[1] = "Win32_SystemEnclosure";
            Query_Select[2] = "Win32_ComputerSystem";
            Query_Select[3] = "Win32_SystemEnclosure";
            Query_Select[4] = "Win32_ComputerSystem";
            string[] Colum_Name = new string[5];
            Colum_Name[1] = "Manufacturer";
            Colum_Name[2] = "Model";
            Colum_Name[3] = "SerialNumber";
            Colum_Name[4] = "PCSystemType";
            WMI_Management Metedo_WMI = new WMI_Management(Query_Select, Colum_Name, 'A');

            this.marca   = Metedo_WMI.Dados_Setar_WMI[1];
            this.modelo  = Metedo_WMI.Dados_Setar_WMI[2];
            this.serial  = Metedo_WMI.Dados_Setar_WMI[3];
            this.tip_maq = Convert.ToInt16(Metedo_WMI.Dados_Setar_WMI[4]);
        }
Пример #2
0
        //Metodos
        private void Get_Data_Hardware_WMI()
        {
            string[] Query_Select = new string[17];
            Query_Select[1]  = "Win32_Processor";
            Query_Select[2]  = "Win32_Processor";
            Query_Select[3]  = "Win32_PhysicalMemory";
            Query_Select[4]  = "Win32_LogicalDisk";
            Query_Select[5]  = "Win32_NetworkAdapter where PhysicalAdapter=true";
            Query_Select[6]  = "Win32_NetworkAdapter where PhysicalAdapter=true";
            Query_Select[7]  = "Win32_NetworkAdapter where PhysicalAdapter=true";
            Query_Select[8]  = "Win32_LogicalDisk where DeviceID='C:'";
            Query_Select[9]  = "Win32_LogicalDisk where DeviceID='D:'";
            Query_Select[10] = "Win32_ComputerSystem";
            Query_Select[11] = "Win32_ComputerSystem";
            Query_Select[12] = "Win32_ComputerSystem";
            Query_Select[13] = "Win32_ComputerSystem";
            Query_Select[14] = "Win32_OperatingSystem";
            Query_Select[15] = "Win32_OperatingSystem";
            Query_Select[16] = "Win32_OperatingSystem";
            string[] Colum_Name = new string[17];
            Colum_Name[1]  = "Manufacturer";
            Colum_Name[2]  = "Name";
            Colum_Name[3]  = "Capacity";
            Colum_Name[4]  = "Size";
            Colum_Name[5]  = "AdapterType";
            Colum_Name[6]  = "Name";
            Colum_Name[7]  = "ConfigManagerErrorCode";
            Colum_Name[8]  = "FreeSpace";
            Colum_Name[9]  = "FreeSpace";
            Colum_Name[10] = "BootupState";
            Colum_Name[11] = "PowerSupplyState";
            Colum_Name[12] = "PowerState";
            Colum_Name[13] = "ThermalState";
            Colum_Name[14] = "Caption";
            Colum_Name[15] = "SerialNumber";
            Colum_Name[16] = "Status";
            WMI_Management Metedo_WMI = new WMI_Management(Query_Select, Colum_Name, 'B');

            this.pro_marca = Metedo_WMI.Dados_Setar_WMI[1];
            this.pro_model = Metedo_WMI.Dados_Setar_WMI[2];
            this.memo_cap  = Metedo_WMI.Dados_Setar_WMI[3];
            this.hd_cap    = Metedo_WMI.Dados_Setar_WMI[4];
            this.tip_rede  = Metedo_WMI.Dados_Setar_WMI[5];
            this.adp_Local = Metedo_WMI.Dados_Setar_WMI[6];
            this.est_rede  = Metedo_WMI.Dados_Setar_WMI[7];

            if (Metedo_WMI.Dados_Setar_WMI[9] == "Não Atribuido.")
            {
                this.hd_liv = Convert.ToInt64(Metedo_WMI.Dados_Setar_WMI[8]).ToString();
            }
            else
            {
                this.hd_liv = Convert.ToString(Convert.ToInt64(Metedo_WMI.Dados_Setar_WMI[8]) + Convert.ToInt64(Metedo_WMI.Dados_Setar_WMI[9]));
            }

            this.est_boot      = Metedo_WMI.Dados_Setar_WMI[10];
            this.est_font      = Metedo_WMI.Dados_Setar_WMI[11];
            this.est_ener      = Metedo_WMI.Dados_Setar_WMI[12];
            this.ther_stat     = Metedo_WMI.Dados_Setar_WMI[13];
            this.sistema       = Metedo_WMI.Dados_Setar_WMI[14];
            this.serialsistema = Metedo_WMI.Dados_Setar_WMI[15];
            this.est_os        = Metedo_WMI.Dados_Setar_WMI[16];
        }