最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在WinNT及Win2000中实现读取网卡物理地址的一段C程序,熟悉C的人员可作参考改进。
时间:2022-07-02 12:03:40 编辑:袖梨 来源:一聚教程网
#include
#include
#include
#include
#include
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 ", 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 ", uRetCode );
if ( uRetCode == 0 )
{
printf( "The Ethernet Number is: %02x%02x%02x%02x%02x%02x ",
#include
#include
#include
#include
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 ", 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 ", uRetCode );
if ( uRetCode == 0 )
{
printf( "The Ethernet Number is: %02x%02x%02x%02x%02x%02x ",
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20