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

查看:2417
本文介绍了如何在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.

地址在Java 6中通过以下API提供:

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天全站免登陆