如何在不使用activex的情况下获取客户端的mac地址
我的主要目的是给每台使用网站的机器一个唯一的id,一种方法是找到客户端的mac地址,但不使用activex,也不能使用cookie分配ID,因为cookie可以被删除并且不能也使用最后一个修改日期方法,所以关于如何分配唯一 ID 的任何想法,谢谢
My main purpose is to give every machine using the website a unique id, one way would be to find the mac address of the client, but not using activex, and also cant assign ID using cookie because cookies can be deleted and not also using last modified date method, so any ideas on how I could assign a unique ID, thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您也许可以使用java小程序来做到这一点,但是HTML和Web浏览器策略经过精心设计,可以防止您做这样的事情,因为它会被认为是重大安全风险。如果没有 ActiveX 控件(如果被发现,可能会因为向 javascript 提供此类个人信息而被禁止,除非您确实仔细计划了安全性)或至少需要一个 Java 小程序,那么 Mac 地址当然是不可能获取的。用户授予其提升的权限。
大多数公司只是分配一个唯一的 ID 并将其存储在浏览器的 cookie 中。有诸如 FireBreath 之类的技术可以轻松创建浏览器插件(activex 控件和 npapi 插件),但同样 - - 你所说的可能是一个非常非常糟糕的主意,所以要小心行事。
You might be able to do this using a java applet, but HTML and web browser policies are very carefully designed to prevent you from doing something like this, as it would be considered a major security risk. A Mac address is certainly not possible to grab without either an activex control (which if discovered would probably get banned for providing such personal information to javascript, unless you had really carefully planned security) or at the very least a java applet that would require the user to grant it elevated privileges.
Most companies just assign a unique id and store it in a cookie in the browser. There are technologies such as FireBreath that make it easy to create browser plugins (activex control and npapi plugin), but again -- what you're talking about has the potential to be a very, very bad idea, so tread with care.
我知道回复这篇文章已经太晚了..但是为了分享我的经验,我发布了我的答案。(我也遇到了同样的问题)
我使用了小程序并将其部署在客户端的计算机上。
我在制作这个小程序后遇到的问题是[当我在本地机器上运行它时它工作正常(作为小程序运行)],但它不能在服务器上运行``
为此,您必须签署您的 jar
Keytool -genkey -alias signFiles -keystore compstore -keypass KEYPASS -dname "cn=XYZ" -storepass KEY -validity 125000
jarsigner -keystore compstore -storepass PASS -keypass KEYPASS appletname.jar signFiles
之后它工作但不顺利..每次我运行它时。浏览器都会请求许可。
这不好。
希望我的经验有帮助
I know its too late to reply for this post..but to share my experience i am posting my answer.(I too faced the same problem)
I used the applet and deployed it on client's machine.
The problem i faced after making this applet is[That it worked fine when i run it on Machine locally (RUN AS APPLET)], buT IT DOESNT WORK ON SERVER``
for that you have to sign your jar
Keytool -genkey -alias signFiles -keystore compstore -keypass KEYPASS -dname "cn=XYZ" -storepass KEY -validity 125000
jarsigner -keystore compstore -storepass PASS -keypass KEYPASS appletname.jar signFiles
After that it worked but not smoothly..as everytime i run it.Browser asks for permission.
which is not good.
I hope my experience helps