阅读:2916回复:5
怎样得到网卡名称及它的MAC地址?????
请大侠指点!!!!!!!!!!
越详细越好!!!!!!!! |
|
最新喜欢:chili |
沙发#
发布于:2002-03-06 17:19
用NETBIOS,网上有源程序,好象MSDN里也有,找找看。
具体有什么问题可以随时提出来! |
|
板凳#
发布于:2002-03-29 19:11
#include <windows.h>
#include <wincon.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include \"string.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( ( char * )ncb.ncb_callname, \"* \" ); ncb.ncb_buffer = ( unsigned 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] ); } } |
|
地板#
发布于:2003-01-02 23:18
要源代码吗?
|
|
|
地下室#
发布于:2003-01-06 21:05
哈哈哈哈,这20分我要了!
这个我知道,我用过: 用GetAdaptersInfo( )这个API就可以了,具体用法看看MSDN就可以了。 你没有说清楚是底层的还是开发Windows程序,所以我这个回答也是正确答案啦,给我20分! |
|
|
5楼#
发布于:2003-01-06 21:07
faint!
居然是1年前的帖子:( 糗大了! :o |
|
|