且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果机器上的某个虚拟适配器具有运行状态为Up,如何获取网络适配器的MAC地址。

更新时间:2023-08-27 16:45:22

您无法在ASP.NET应用程序中获取客户端MAC地址。



您发布的代码是获取SERVER上的接口,而不是客户端。 ASP.NET代码总是完全在服务器上运行,而不是客户端。



此外,MAC地址在客户端所在的网络之外没有意义。它不是全局唯一值,不能用于唯一标识客户端。
You can NOT get the client MAC address in an ASP.NET application.

The code you posted is getting the interfaces on the SERVER, not the client. ASP.NET code always runs entirely on the server, never the client.

Also, the MAC address is meaningless outside of the network the client is sitting on. It is NOT a globally unique value and cannot be used to identify a client uniquely.