CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    17

    Processor-ID or Unique-ID



    Hy there!


    I want to read the processor-ID or an other unique ID of a pc.


    Does anybody know, how i can do this?

  2. #2
    Join Date
    Mar 1999
    Posts
    4

    Re: Processor-ID or Unique-ID



    There is really no such thing except under a PIII. About the best you can do is use the MAC number from the network card (if there is one there) or the serial number from the disk drive. Look on DejaNews and you will find plenty of examples of each.

  3. #3
    Join Date
    Apr 1999
    Posts
    7

    Re: Processor-ID or Unique-ID

    Just a solution, using MAC address.
    I've got the code from Mats Bejedahl.

    #include <nb30.h>

    typedef struct _ASTAT_
    {
    ADAPTER_STATUS adapt;
    NAME_BUFFER NameBuff [30];
    }ASTAT, * PASTAT;


    void GetMACAddr()
    {
    ASTAT Adapter;
    NCB Ncb;
    UCHAR uRetCode;
    LANA_ENUM lenum;
    int i;

    memset( &Ncb, 0, sizeof(Ncb) );
    Ncb.ncb_command = NCBENUM;
    Ncb.ncb_buffer = (UCHAR *)&lenum;
    Ncb.ncb_length = sizeof(lenum);
    uRetCode = Netbios( &Ncb );

    for(i=0; i < lenum.length ;i++)
    {
    memset( &Ncb, 0, sizeof(Ncb) );
    Ncb.ncb_command = NCBRESET;
    Ncb.ncb_lana_num = 0;
    uRetCode = Netbios( &Ncb );

    memset( &Ncb, 0, sizeof (Ncb) );
    Ncb.ncb_command = NCBASTAT;
    Ncb.ncb_lana_num = lenum.lana[i];

    strcpy( (char*)Ncb.ncb_callname, "* " );
    Ncb.ncb_buffer = (unsigned char *) &Adapter;
    Ncb.ncb_length = sizeof(Adapter);

    uRetCode = Netbios( &Ncb );

    if ( uRetCode == 0 )
    {
    TRACE("MAC address %02X-%02X-%02X-%02X-%02X-%02X\n",
    Adapter.adapt.adapter_address[0],
    Adapter.adapt.adapter_address[1],
    Adapter.adapt.adapter_address[2],
    Adapter.adapt.adapter_address[3],
    Adapter.adapt.adapter_address[4],
    Adapter.adapt.adapter_address[5] );
    }
    }
    }




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured