I use GetAdaptersInfo to get MAC addresses of interfaces.
 
GetAdaptersInfo exist on old and new versions of Windows. 
But msdn warns :
    "On Windows XP and later:  Use the GetAdaptersAddresses 
      function instead of GetAdaptersInfo."
Why ? I suspect it is because GetAdaptersAddresses  adds ipv6; GetAdaptersInfo does not have ipv6 addresses.
But I do not need ipv6 addresses.
 
It is difficult to use GetAdaptersAddresses because W2k does not have GetAdaptersAddresses . I need to support w2 and newer oses, too, so here is my question.
 
Is there sesious reason to prefer GetAdaptersAddresses to GetAdaptersInfo when getting MAC addresses of interfaces ?
 
Hi Viki,

To me, it sounds like perhaps GetAdaptersInfo may be dropped at some future point.  Your code could detect W2K and use GetAdaptersInfo, and on XP+ use GetAdaptersAddresses.  I suppose, it comes down to whether you do the work now, or when / if GetAdaptersInfo is dropped.

GetAdaptersInfo & GetAdaptersAddresses的更多相关文章

  1. 【转载】GetAdaptersInfo函数在64位系统上返回ERROR_NOACCESS的有关问题

    From:http://www.educity.cn/wenda/351190.html GetAdaptersInfo函数在64位系统下返回ERROR_NOACCESS的问题 实际应用中一个程序在长 ...

  2. 获取mac地址方法之一 GetAdaptersInfo()

    GetAdaptersInfo -20151116 防止返回的mac出现null 20151116 From:http://blog.csdn.net/weiyumingwww/article/det ...

  3. IP HELPER GetAdaptersAddresses 函数

    自己做的一些笔记,XP以及以后的系统使用: MSDN 函数:http://msdn.microsoft.com/en-US/library/windows/desktop/aa365915(v=vs. ...

  4. 使用GetAdaptersInfo时,网卡类型的值为71

    使用GetAdaptersInfo时,网卡类型的值为71,代表无线网卡.

  5. 【转载】 用 Windows API “GetAdaptersInfo” 获取 MAC 时遇到的问题

    From:http://blog.csdn.net/weiyumingwww/article/details/17554461 前段时间有个项目需要获取客户端的 MAC 地址,用作统计去重的参考数据. ...

  6. GetAdaptersInfo获取网卡配置和Ip地址信息

    一台机器上可能不只有一个网卡,但每一个网卡只有一个MAC地址,而每一个网卡可能配置有多个IP地址:如平常的笔记本电脑中,就会有无线网卡和有线网卡(网线接口)两种:因此,如果要获得本机所有网卡的IP和M ...

  7. WinAPI你知道多少?!(上千个,好多都没见过)

    http://www.cnblogs.com/vanver/archive/2013/06/13/NO-2013_06_13pm.html 播客开篇,讲讲废话:本篇播客只是推荐给热与钻研的同学们... ...

  8. Windows网络接口API函数

    Windows提供了一套非常轻量级的网络函数,方便进行网络应用开发,整理出来供参考使用. The following functions are used in Windows networking: ...

  9. VC++ IPv6的支持

    最近根据项目需要,要在产品中添加对IpV6的支持,因此研究了一下IPV6的相关内容,Ipv6 与原来最直观的改变就是地址结构的改变,IP地址由原来的32位扩展为128,这样原来的地址结构肯定就不够用了 ...

随机推荐

  1. mybatis的一些特殊符号标识(大于,小于,等于,不等于)

    特殊字符   替代符号(红色基本为常用的)    &            &      <            <      >            > ...

  2. 如何去掉Json字符串中反斜杠

    做项目的时候,遇到了这样的问题,前台传来的Json字符串在实体类中不对应(无法转换为实体类),而且传来的数据项是跟着数据库中的表的变动而变动的(不能重写实体类). 前台Json字符串为: string ...

  3. windows下mysql 5.7的配置全过程

    这是一套在好多次的安装下总结出来的经验,包括很多种遇到的问题,查过很多资料,特此总结一下. 一.从官网下载MySQL的zip(免安装的) 解压mysql-5.7.11-winx64.zip到自己指定的 ...

  4. 【Mysql优化】索引优化策略

    1:索引类型 1.1 B-tree索引 注: 名叫btree索引,大的方面看,都用的平衡树,但具体的实现上, 各引擎稍有不同, 比如,严格的说,NDB引擎,使用的是T-tree   Myisam,in ...

  5. EL表达式中获取list长度(JSTL函数用法)

    在jsp页面中不能通过${list.size}取列表长度,而是 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" pref ...

  6. Dancing Links [Kuangbin带你飞] 模版及题解

    学习资料: http://www.cnblogs.com/grenet/p/3145800.html http://blog.csdn.net/mu399/article/details/762786 ...

  7. win端git连接私服仓库+上传本地项目+从服务器下载文件到win

    win端git连接私服仓库: 1.win端 检查c:/Users/用户/.ssh/目录下是否有config文件(!!!没有任何后缀名).如果没有则新建config文件,然后修改添加如下内容: Host ...

  8. Oracle基础 07 参数文件 pfile/spfile

    --查看数据库运行模式(spfile还是pfile)select decode(count(*),1,'spfile','pfile') from v$spparameterwhere rownum= ...

  9. 【bzoj4282】慎二的随机数列

    扯几句题外的,最近在看Fate/StayNight,对此人毫无好感…… 每次减一下当前可辨认数,然后随意dp一个LIS,最后记得加回去就好. #include<bits/stdc++.h> ...

  10. 搭建Spring框架,实现添加数据到数据库

    原创链接:http://www.cnblogs.com/yanqin/p/5284400.html (允许转载,但请注明原创链接) 1.在myeclipse中建立一个web项目 项目名 :spring ...