gpt4 book ai didi

c# - 使用 C# 禁用 NIC 时在 Windows 7 中获取 MAC 地址

转载 作者:太空宇宙 更新时间:2023-11-03 14:14:51 24 4
gpt4 key购买 nike

我需要一种方法来检索装有 Windows 7 的机器的 MAC 地址,当它的 Network Interface Card 被禁用并使用 C#。我在网上搜索并引用了以下链接。使用第二个链接中的答案,我可以在 Windows XP 中成功获取所需的详细信息,但在禁用 NIC 时不能在 Windows 7 中获取。

Getting MAC address C#

Get MAC Address when network adapter is disabled?

有谁知道如何完成这个任务???

谢谢...

最佳答案

我认为您需要缓存 MAC 地址。例如,启用网卡后,您可以更新该网卡缓存中的 MAC 地址。稍后,当它被禁用并且您无法从 Windows 获取 MAC 时,您可以从缓存中获取它。

您无法从甚至未加载的驱动程序中获取 MAC 地址。并且需要驱动程序从网卡的ROM芯片中加载MAC地址。因此,如果 Windows 确实有办法从禁用的网卡中获取 MAC 地址,那么缓存 MAC 必须与 Windows 使用的技术相同。

关于c# - 使用 C# 禁用 NIC 时在 Windows 7 中获取 MAC 地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6825400/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com