Solved

Detect individual Hardware GUID number (like punkbuster)

Posted on 2004-09-21
3
291 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 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