更新时间:2022-05-08 22:25:14
实现这一目标的唯一方法是使用小程序或插件,例如可以用 Java 编程(尽管根据
The only way to achieve this is by using an applet or plugin which could for example be programmed in java (although java itself might not allow it according to Getting MAC address on a web page using a Java applet ), as javascript will naturally not disclose this kind of information. Lastly you could also find this information from the server side if it's on an internal network as is often done with semi-private wifi network landing pages.
基于以下评论:由于它是内部网络,您可以在asp.net端按如下方式检索mac地址.您执行以下命令 arp -a
它将返回所有 ip 地址的列表以及关联的 mac 地址.接下来使用类似
Based on the comments below: As it's an internal network you can retrieve the mac address as follows on the asp.net side. You execute the following command arp -a
which will return you a list of all ip addresses with associated mac addresses. Next using something along the lines of
Request.Servervariables("REMOTE_ADDR")
您应该能够找到用户的 ip 地址,接下来您可以将其与从 arp 命令检索到的数据进行匹配,瞧,您拥有当前用户的 mac 地址.
you should be able to find the users ip address which you can next match with the data you retrieved from the arp command and voila, you have your mac address for the current user.