Solved

Detect individual Hardware GUID number (like punkbuster)

Posted on 2004-09-21
3
289 Views
Last Modified: 2012-06-27
Hello,

i read the news on PunkBuster ( http://www.punkbuster.com/index.php?page=announce.php ) and i saw the new function called 'Detecting individual Hardware GUID' (i think it's the motherboard product number), and storing it in a hashcode so that the computer could be identified with a single hashcode. I found that pretty interesting.

So have you got some ideas how to get an individual hardware GUID hashcode (perhaps motherboard product number) ?

Thanks
Manuel K.
0
Comment
Question by:roflkind
3 Comments
 
LVL 4

Accepted Solution

by:
thedude112286 earned 200 total points
ID: 12117970
Below, I give the code to find the HD serial numbers, CPU Id, and MAC address of a computer.  These can be combined to form a unique ID for a computer (This is essentially the info Microsoft uses to ID computers when registering Windows XP).  Lookup the Management class on msdn for more info.

using System.Management;

//Add HD serial numbers
ManagementClass mc = new ManagementClass("Win32_PhysicalMedia");
foreach ( ManagementObject mo in mc.GetInstances() ) {
    if ( mo["SerialNumber"] != null)
      data.DriveSerialNumbers.Add(mo["SerialNumber"].ToString());
    }
                  
//Add processor ID
mc = new ManagementClass("Win32_Processor");
foreach ( ManagementObject mo in mc.GetInstances() ) {
    if ( mo["ProcessorID"] != null ) {
         data.ProcessorID = mo.Properties["ProcessorId"].Value.ToString();
         break; // just log 1 processor
     }
}
           
//Add Mac Address of first network card
mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
foreach ( ManagementObject mo in mc.GetInstances() ) {
    if((bool)mo["IPEnabled"] == true)
        data.MacAddress = mo["MacAddress"].ToString() ;
    }
}
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 25 total points
ID: 12119694
for Motherboard's serial number
you can use

ManagementClass mc = new ManagementClass("Win32_BaseBoard");
      foreach ( ManagementObject mo in mc.GetInstances() ) {
            if ( mo["SerialNumber"] != null)
            Console.WriteLine(mo["SerialNumber"].ToString());
      }
0
 
LVL 7

Assisted Solution

by:God_Ares
God_Ares earned 25 total points
ID: 12123391
well the samples above will give you a how to,.. this link a reference to all wmi's

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_networkadapterconfiguration.asp

have fun!

regards Floris Briolas
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get String split 5 46
Is setting this variable making a duplicate in memory 4 29
Excel file not created as expected 7 46
Filename to be appended with DateTimeof Download 3 40
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now