none
CPU information

    Question

  • Hallo,

    Can someone tell me how I can get CPU information such as the name, speed, and the temperature and display them in a label?

    Thank you. Silke <g class="gr_ gr_172 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="172" id="172">Liefting</g>


    Sl

    Tuesday, April 18, 2017 2:25 PM

All replies

  • WMI for example (Win32_Processor and others)
    Tuesday, April 18, 2017 2:31 PM
  • Can you please show an example?

    Sl

    Tuesday, April 18, 2017 2:48 PM
  • There are plenty of samples from Google, but you can use

    WMI Code Creator

    Tuesday, April 18, 2017 2:55 PM
  • Fantastic!

    How can I use this in my Windows Form Appilication.


    Sl

    Tuesday, April 18, 2017 3:34 PM
  • For example, with a TextBox textBox1, for the CPU name (if 1 CPU):

     try
                    {
                        ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor");
                        foreach (ManagementObject queryObj in searcher.Get())
                        {
                            textBox1.Text = queryObj["Caption"].ToString();
                        }
                    }
                    catch (ManagementException ex)
                    {
                        MessageBox.Show("An error occurred while querying for WMI data: " + ex.Message);
                    }

    • Edited by Castorix31 Tuesday, April 18, 2017 3:57 PM
    Tuesday, April 18, 2017 3:56 PM