从 UUID 中提取 MAC 地址 [英] Extracting MAC addresses from UUIDs

查看:115
本文介绍了从 UUID 中提取 MAC 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的一个程序假定由 Windows RPC API 调用 UuidCreateSequential() 生成的 UUID 包含主以太网适配器的 MAC 地址.这个假设是正确的还是我应该使用不同的方法来获取 MAC 地址?

A program that I work on assumes that the UUID generated by the Windows RPC API call UuidCreateSequential() contains the MAC address of the primary ethernet adapter. Is this assumption correct or should I use a different method to get the MAC address?

推荐答案

我不会依赖于此 - UuidCreateSequential 具有 MAC 地址的唯一原因是它试图保证 UUID 在整个网络中是唯一的.另外,你为什么要使用这种奇怪的方式来获取 MAC 地址?使用 WMI 并且实际上请求 MAC 地址而不是 UUID 创建函数的副作用.

I wouldn't rely on this - the only reason that UuidCreateSequential has the MAC address is it's trying to guarantee that the UUID is unique across the network. Plus, why would you use such a weird way to get a MAC address? Use WMI and actually ask for the MAC address instead of a side-effect of a UUID creation function.

这篇关于从 UUID 中提取 MAC 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆