DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 6 of 6

Thread: Network Card ID

  1. #1
    Eyup Gurel Guest

    Network Card ID


    I will use the unique Network card ID to device bind my license file. How
    can I obtain it? The GUIDGEN.exe and CoCreateGUID is doing this but how?Is
    there an API?

  2. #2
    Stephen Guest

    Re: Network Card ID


    I assume you are talking about the MAC address. If you are using NT
    the command IPCONFIG /ALL will show the MAC address under the heading: Physical
    Address.



    "Eyup Gurel" <egl@linkbilgisayar.com.tr> wrote:
    >
    >I will use the unique Network card ID to device bind my license file. How
    >can I obtain it? The GUIDGEN.exe and CoCreateGUID is doing this but how?Is
    >there an API?



  3. #3
    MIchael Howard Guest

    Re: Network Card ID


    try this code:

    #include <windows.h>
    #include <wincon.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>

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

    ASTAT Adapter;

    void main (void)
    {
    NCB ncb;
    UCHAR uRetCode;
    char NetName[50];

    memset( &ncb, 0, sizeof(ncb) );
    ncb.ncb_command = NCBRESET;
    ncb.ncb_lana_num = 0;

    uRetCode = Netbios( &ncb );
    printf( "The NCBRESET return code is: 0x%x \n", uRetCode );

    memset( &ncb, 0, sizeof(ncb) );
    ncb.ncb_command = NCBASTAT;
    ncb.ncb_lana_num = 0;

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

    uRetCode = Netbios( &ncb );
    printf( "The NCBASTAT return code is: 0x%x \n", uRetCode );
    if ( uRetCode == 0 )
    {
    printf( "The Ethernet Number is: %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] );
    }
    }


  4. #4
    Hrishi Guest

    Re: Network Card ID


    Hi Mike,

    The Below code gives a linking error. Can u please specify which .lib file
    to be included for the method NetBios()?
    Thanx

    Hrishi Dhruv

    Note:
    Linking Error Msg :
    ***********************

    Linking...
    Network.obj : error LNK2001: unresolved external symbol _Netbios@4
    Debug/Network.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    ************************
    Network.exe - 2 error(s), 0 warning(s)


    "MIchael Howard" <mikehow@microsoft.com> wrote:
    >
    >try this code:
    >
    >#include <windows.h>
    >#include <wincon.h>
    >#include <stdlib.h>
    >#include <stdio.h>
    >#include <time.h>
    >
    >typedef struct _ASTAT_
    >{
    > ADAPTER_STATUS adapt;
    > NAME_BUFFER NameBuff [30];
    >}ASTAT, * PASTAT;
    >
    >ASTAT Adapter;
    >
    >void main (void)
    >{
    > NCB ncb;
    > UCHAR uRetCode;
    > char NetName[50];
    >
    > memset( &ncb, 0, sizeof(ncb) );
    > ncb.ncb_command = NCBRESET;
    > ncb.ncb_lana_num = 0;
    >
    > uRetCode = Netbios( &ncb );
    > printf( "The NCBRESET return code is: 0x%x \n", uRetCode );
    >
    > memset( &ncb, 0, sizeof(ncb) );
    > ncb.ncb_command = NCBASTAT;
    > ncb.ncb_lana_num = 0;
    >
    > strcpy( ncb.ncb_callname, "* " );
    > ncb.ncb_buffer = (char *) &Adapter;
    > ncb.ncb_length = sizeof(Adapter);
    >
    > uRetCode = Netbios( &ncb );
    > printf( "The NCBASTAT return code is: 0x%x \n", uRetCode );
    > if ( uRetCode == 0 )
    > {
    > printf( "The Ethernet Number is: %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] );
    > }
    >}
    >



  5. #5
    Join Date
    Mar 2005
    Posts
    1

    Cool

    Just go to Project->Settings then Link Tab and Add link to netapi32.dll

  6. #6
    Join Date
    Apr 2005
    Posts
    1

    Unhappy netbios32.dll is nowhere to be found

    Hello,

    Is this a file that I need to download from M$?

    Because I have XPHome and it does not have this file.

    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links