How Can I get the Processor Id from my computer

  • Thread starter Thread starter Juan Manuel Alegría B.
  • Start date Start date
J

Juan Manuel Alegría B.

Hi group, I´m working with a .NET application and I need to know the
Processor ID or Motherboard ID. Is there a way to get it?

Thanks so much.

JMAB, Guadalajara, México.
 
string s = "SELECT SerialNumber FROM WIN32_BaseBoard";
System.Management.ManagementObjectSearcher oWMI = new
System.Management.ManagementObjectSearcher(s);
System.Management.ManagementObjectCollection oSerialNumbers = oWMI.Get();

foreach (System.Management.ManagementObject mo in oSerialNumbers)
{
Console.WriteLine("Serial Number: " +
mo.Properties["SerialNumber"].Value.ToString());
}
 
Thaks for your help, I already tested the example and It works perfect.

There is only a problem. I made an asembly to test it in several
computers, but in some computers doesn't return the serial number I mean
returns as blank space or empty string. Do you know if I need to consider
something else.

Thanks...

gui_guru said:
string s = "SELECT SerialNumber FROM WIN32_BaseBoard";
System.Management.ManagementObjectSearcher oWMI = new
System.Management.ManagementObjectSearcher(s);
System.Management.ManagementObjectCollection oSerialNumbers = oWMI.Get();

foreach (System.Management.ManagementObject mo in oSerialNumbers)
{
Console.WriteLine("Serial Number: " +
mo.Properties["SerialNumber"].Value.ToString());
}

Juan Manuel Alegría B. said:
Hi group, I´m working with a .NET application and I need to know the
Processor ID or Motherboard ID. Is there a way to get it?

Thanks so much.

JMAB, Guadalajara, México.
 
Sorry, I don't know why it wouldn't work (or why the value would be blank).
There may be other values you could look at. Change the "SELECT SerialNumber"
to "SELECT *" and loop through the properties to see if there is another you
could use.

Juan Manuel Alegría B. said:
Thaks for your help, I already tested the example and It works perfect.

There is only a problem. I made an asembly to test it in several
computers, but in some computers doesn't return the serial number I mean
returns as blank space or empty string. Do you know if I need to consider
something else.

Thanks...

gui_guru said:
string s = "SELECT SerialNumber FROM WIN32_BaseBoard";
System.Management.ManagementObjectSearcher oWMI = new
System.Management.ManagementObjectSearcher(s);
System.Management.ManagementObjectCollection oSerialNumbers = oWMI.Get();

foreach (System.Management.ManagementObject mo in oSerialNumbers)
{
Console.WriteLine("Serial Number: " +
mo.Properties["SerialNumber"].Value.ToString());
}

Juan Manuel Alegría B. said:
Hi group, I´m working with a .NET application and I need to know the
Processor ID or Motherboard ID. Is there a way to get it?

Thanks so much.

JMAB, Guadalajara, México.
 
Back
Top