如何在 Java 中获取唯一的计算机标识符(如磁盘 ID 或主板 ID)? [英] How to get a unique computer identifier in Java (like disk ID or motherboard ID)?

查看:93
本文介绍了如何在 Java 中获取唯一的计算机标识符(如磁盘 ID 或主板 ID)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows、MacOS 和 Linux(如果可能)上使用 Java 获得唯一的 id.它可能是磁盘 UUID、主板 S/N...

I'd like to get an id unique to a computer with Java, on Windows, MacOS and, if possible, Linux. It could be a disk UUID, motherboard S/N...

Runtime.getRuntime().exec 可以使用(它不是小程序).

Runtime.getRuntime().exec can be used (it is not an applet).

想法?

推荐答案

MAC 地址与网卡关联的情况很常见.

It is common to use the MAC address is associated with the network card.

该地址可通过以下 API 在 Java 6 中获得:

The address is available in Java 6 through through the following API:

Java 6 文档硬件地址

我没有在 Java 中使用过它,但对于其他网络识别应用程序,它很有帮助.

I haven't used it in Java, but for other network identification applications it has been helpful.

这篇关于如何在 Java 中获取唯一的计算机标识符(如磁盘 ID 或主板 ID)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆