.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Get the processor id using c#

Posted By:Hiren Soni       Posted Date: August 29, 2010    Points: 10    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Get the processor id using c#
 


learn how to Get the processor id using c#


Get the processor id using c#



First add the reference System.Management from COM tab.

Code:



using System.Management;



ManagementObjectSearcher mo = new ManagementObjectSearcher("select * from Win32_Processor");



foreach (ManagementObject mob in mo.Get())

{

try

{

listBox1.Items.Add(mob["ProcessorId"].ToString());



}

catch (Exception ex)

{

// handle exception

}

}

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend