如何获取Java中每个用户/ PC的唯一ID或字符串?

时间:2021-05-29 16:45:51

As you can read in the title, I'm looking for a unique ID or String to identify users or PC's. I'm creating a Java script with a security method which uses a unique ID or String. I used the MAC Address before, but since an update at the developers I'm coding for, this isn't allowed anymore. Is there another way to get some sort of unique ID to identify users or pc's which is allowed? For more information: I'm coding for RSBot, which is an open-source program which runs user created Java scripts.

正如您可以在标题中看到的那样,我正在寻找一个唯一的ID或字符串来识别用户或PC。我正在创建一个带有安全方法的Java脚本,该方法使用唯一的ID或String。之前我使用过MAC地址,但是由于我正在编写的开发人员的更新,这是不允许的。是否有另一种方法可以获得某种唯一ID来识别允许的用户或PC?有关更多信息:我正在编写RSBot,这是一个运行用户创建的Java脚本的开源程序。

Thanks in advance, Kevin.

凯文,提前谢谢。

2 个解决方案

#1


0  

See java.util.UUID, specifically:

请参阅java.util.UUID,具体如下:

UUID.randomUUID();

http://download.oracle.com/javase/1,5.0/docs/api/java/util/UUID.html#randomUUID()

Note that this is random, but not reproducible. If you need to be able to generate the same ID over and over on the same computer this is not what you need.

请注意,这是随机的,但不可重复。如果您需要能够在同一台计算机上反复生成相同的ID,则这不是您所需要的。

#2


0  

You may also want to look at JUG -

你可能也想看看JUG -

GUUIDs based on the Ethernet device, random, time, etc

GUUID基于以太网设备,随机,时间等

http://wiki.fasterxml.com/JugHome

#1


0  

See java.util.UUID, specifically:

请参阅java.util.UUID,具体如下:

UUID.randomUUID();

http://download.oracle.com/javase/1,5.0/docs/api/java/util/UUID.html#randomUUID()

Note that this is random, but not reproducible. If you need to be able to generate the same ID over and over on the same computer this is not what you need.

请注意,这是随机的,但不可重复。如果您需要能够在同一台计算机上反复生成相同的ID,则这不是您所需要的。

#2


0  

You may also want to look at JUG -

你可能也想看看JUG -

GUUIDs based on the Ethernet device, random, time, etc

GUUID基于以太网设备,随机,时间等

http://wiki.fasterxml.com/JugHome