Solved

Detect individual Hardware GUID number (like punkbuster)

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applicationsā€¦
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

19 Experts available now in Live!

Get 1:1 Help Now