如何获取ASP.NET浏览网站的客户端的mac地址 [英] How to get mac address of client that browse web site by ASP.NET
本文介绍了如何获取ASP.NET浏览网站的客户端的mac地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
该代码将返回托管mac地址,但我想要客户端系统mac地址。
我尝试过:
Hello every one,
thats code will be return hosting mac address but i want client system mac address.
What I have tried:
string macAddresses = string.Empty;
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
macAddresses = nics[0].GetPhysicalAddress().ToString();
推荐答案
你不能:如果可以,它就无济于事。
MAC地址不会传输到连接LAN网段和互联网的路由器之外 - 它不是'建立PC和路由器之间的初始连接并分配本地IP地址后需要或使用。
此外,MAC地址不是唯一的:它们只需要在PC和路由器所在的网段。而且它们难以置信地欺骗!
在客户端使用cookie,结合良好的安全性 - MAC寻址对你没有帮助。
You can't: and it wouldn't help if you could.
MAC addresses are not transferred beyond the router which connects the LAN segment to the internet - it isn't needed or used after the initial connection between the the PC and the router is established and a local IP address is assigned.
In addition, MAC addresses are not unique: they just have to be unique within the network segment that the PC and router are on. And they are unbelievably easy to "spoof"!
Use a cookie on the client, combined with decent security - MAC addressing will not help you.
这篇关于如何获取ASP.NET浏览网站的客户端的mac地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文