Exemple #1
0
        private void CPInfo_Load(object sender, EventArgs e)
        {
            CollectingData loadForm = new CollectingData();

            loadForm.Show();
            string cpName = OutputResult(GetHardwareInfo("Win32_Processor", "Name"));

            String[] parametrs = cpName.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            textBox1.Text = GetData(parametrs);
            textBox2.Text = OutputResult(GetHardwareInfo("Win32_Processor", "Manufacturer"));
            textBox6.Text = OutputResult(GetHardwareInfo("Win32_Processor", "Name"));
            textBox5.Text = OutputResult(GetHardwareInfo("Win32_Processor", "MaxClockSpeed")) + " MHz";
            textBox3.Text = OutputResult(GetHardwareInfo("Win32_Processor", "CurrentVoltage")) + " B";
            if (OutputResult(GetHardwareInfo("Win32_Processor", "L1CacheSize")).Length < 1)
            {
                textBox7.Text = "-";
            }
            else
            {
                textBox7.Text = OutputResult(GetHardwareInfo("Win32_Processor", "L1CacheSize"));
            }
            textBox8.Text  = OutputResult(GetHardwareInfo("Win32_Processor", "L2CacheSize")) + " Kb";
            textBox9.Text  = OutputResult(GetHardwareInfo("Win32_Processor", "L3CacheSize")) + " Kb";
            textBox10.Text = OutputResult(GetHardwareInfo("Win32_Processor", "NumberOfCores"));
            textBox11.Text = OutputResult(GetHardwareInfo("Win32_Processor", "AddressWidth")) + " bits";
            textBox13.Text = OutputResult(GetHardwareInfo("Win32_Processor", "NumberOfLogicalProcessors"));
            textBox14.Text = OutputResult(GetHardwareInfo("Win32_Processor", "ExtClock")) + " MHz";

            loadForm.Close();
        }
Exemple #2
0
        private void Memory_Load(object sender, EventArgs e)
        {
            CollectingData loadForm = new CollectingData();

            loadForm.Show();
            int slotCount = CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "MaxVoltage").Count;

            textBox1.Text       = "" + slotCount;
            richTextBox1.Height = 21 * slotCount;
            richTextBox1.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "Capacity"), "bytes");
            richTextBox2.Height = 21 * slotCount;
            richTextBox2.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "ConfiguredClockSpeed"), "MHz");
            richTextBox3.Height = 21 * slotCount;
            richTextBox3.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "MinVoltage"), "B");
            richTextBox4.Height = 21 * slotCount;
            richTextBox4.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "MaxVoltage"), "B");
            richTextBox5.Height = 21 * slotCount;
            richTextBox5.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "DeviceLocator"), "");
            richTextBox6.Height = 21 * slotCount;
            richTextBox6.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "Manufacturer"), "");
            richTextBox7.Height = 21 * slotCount;
            richTextBox7.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "SerialNumber"), "");
            richTextBox8.Height = 21 * slotCount;
            richTextBox8.Text   = GenerateResult(CPInfo.GetHardwareInfo("Win32_PhysicalMemory", "FormFactor"), "");
            loadForm.Close();
        }