-
2021-03-13 03:07:18
java怎么获取客户端的唯①标识?
ip和mac不要,最好能获取硬件的唯①标识并且能跨系统的,在windows和mac系统都能获取得到.
PU序列号
Process process = Runtime.getRuntime(), getwmic".exec(
new String[] { : ProcessorId });
process.getOutputStream().close();
Scanner sc = new Scanner(process;
String property = sc.next();
System.out.println(property +
String serial = sc.next();, cpu;, "
孩子,
有人的地方就有江湖,
有江湖的地方就有恩怨,
有恩怨的地方就有情仇,
有情仇的地方就有故事,
故事说得多了,就变成了传说,
传说千年,就有了无数的演义,
演义的世界里,还有无数的版本,
每①个版本,都有无数的爱恨纠葛,
有慷慨,
有激昂,
有缠绵,
有绯侧,
有哀怨,
有壮烈,
……
但是,他们都有①个共同的主题:
有人的地方就有江湖,
有江湖的地方就有恩怨,
有恩怨的地方就有情仇,
有情仇的地方就有故事,
……
什么?太无聊了?你确定这个问题不是来搞笑的?\", \"extras\": \"\", \"created_time\": ①④④③⑦⑤①⑨②⓪ · \"type\": \"answer
编后语:关于《java获取客户端唯一标识50?为什么样很多C开发者瞧不起Java》关于知识就介绍到这里,希望本站内容能让您有所收获,如有疑问可跟帖留言,值班小编第一时间回复。
下一篇内容是有关《汇编中讲的“外设接口”在物理上是什么样?新版cf什么样活动可以获得太极扇》,感兴趣的同学可以点击进去看看。
资源转载网络,如有侵权联系删除。
更多相关内容 -
Java 获取计算机唯一标识
2020-10-15 16:38:53import lombok.Data; import lombok.extern.slf4j.Slf4j; import java.io.*; import java.net.InetAddress;...import java.net.NetworkInterface;...import java.util.ArrayList;...import java.util....import java.uti.import com.imis.base.constant.CommonConstant; import lombok.Data; import lombok.extern.slf4j.Slf4j; import java.io.*; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * <p> * ComputerUniqueIdentificationUtil<br> * 计算机唯一识别实用程序 * </p> * * @author XinLau * @version 1.0 * @since 2020年10月10日 17:14 */ @Slf4j public class ComputerUniqueIdentificationUtil { /** * Windows */ public static final String WINDOWS = "windows"; /** * Linux */ public static final String LINUX = "linux"; /** * Unix */ public static final String UNIX = "unix"; /** * 正则表达式 */ public static final String REGEX = "\\b\\w+:\\w+:\\w+:\\w+:\\w+:\\w+\\b"; /** * 获取 Windows 主板序列号 * * @return String - 计算机主板序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getWindowsMainBoardSerialNumber() { String result = ""; try { File file = File.createTempFile("realhowto", ".vbs"); file.deleteOnExit(); FileWriter fw = new java.io.FileWriter(file); String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + " (\"Select * from Win32_BaseBoard\") \n" + "For Each objItem in colItems \n" + " Wscript.Echo objItem.SerialNumber \n" + " exit for ' do the first cpu only! \n" + "Next \n"; fw.write(vbs); fw.close(); Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath()); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while ((line = input.readLine()) != null) { result += line; } input.close(); } catch (Exception e) { log.error("获取 Windows 主板信息错误", e); } return result.trim(); } /** * 获取 Linux 主板序列号 * * @return String - 计算机主板序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getLinuxMainBoardSerialNumber() { String result = ""; String maniBord_cmd = "dmidecode | grep 'Serial Number' | awk '{print $3}' | tail -1"; Process p; try { // 管道 p = Runtime.getRuntime().exec(new String[]{"sh", "-c", maniBord_cmd}); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while ((line = br.readLine()) != null) { result += line; break; } br.close(); } catch (IOException e) { log.error("获取 Linux 主板信息错误", e); } return result; } /** * 从字节获取 MAC * * @param bytes - 字节 * @return String - MAC * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/12 8:55 */ private static String getMacFromBytes(byte[] bytes) { StringBuffer mac = new StringBuffer(); byte currentByte; boolean first = false; for (byte b : bytes) { if (first) { mac.append("-"); } currentByte = (byte) ((b & 240) >> 4); mac.append(Integer.toHexString(currentByte)); currentByte = (byte) (b & 15); mac.append(Integer.toHexString(currentByte)); first = true; } return mac.toString().toUpperCase(); } /** * 获取 Windows 网卡的 MAC 地址 * * @return String - MAC 地址 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getWindowsMACAddress() { InetAddress ip = null; NetworkInterface ni = null; List<String> macList = new ArrayList<String>(); try { Enumeration<NetworkInterface> netInterfaces = (Enumeration<NetworkInterface>) NetworkInterface .getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { ni = (NetworkInterface) netInterfaces.nextElement(); // 遍历所有 IP 特定情况,可以考虑用 ni.getName() 判断 Enumeration<InetAddress> ips = ni.getInetAddresses(); while (ips.hasMoreElements()) { ip = (InetAddress) ips.nextElement(); // 非127.0.0.1 if (!ip.isLoopbackAddress() && ip.getHostAddress().matches("(\\d{1,3}\\.){3}\\d{1,3}")) { macList.add(getMacFromBytes(ni.getHardwareAddress())); } } } } catch (Exception e) { log.error("获取 Windows MAC 错误", e); } if (macList.size() > 0) { return macList.get(0); } else { return ""; } } /** * 获取 Linux 网卡的 MAC 地址 (如果 Linux 下有 eth0 这个网卡) * * @return String - MAC 地址 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getLinuxMACAddressForEth0() { String mac = null; BufferedReader bufferedReader = null; Process process = null; try { // Linux下的命令,一般取eth0作为本地主网卡 process = Runtime.getRuntime().exec("ifconfig eth0"); // 显示信息中包含有 MAC 地址信息 bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null; int index = -1; while ((line = bufferedReader.readLine()) != null) { // 寻找标示字符串[hwaddr] index = line.toLowerCase().indexOf("hwaddr"); if (index >= 0) { // // 找到并取出 MAC 地址并去除2边空格 mac = line.substring(index + "hwaddr".length() + 1).trim(); break; } } } catch (IOException e) { log.error("获取 Linux MAC 信息错误", e); } finally { try { if (bufferedReader != null) { bufferedReader.close(); } } catch (IOException e1) { log.error("获取 Linux MAC 信息错误", e1); } bufferedReader = null; process = null; } return mac; } /** * 获取 Linux 网卡的 MAC 地址 * * @return String - MAC 地址 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getLinuxMACAddress() { String mac = null; BufferedReader bufferedReader = null; Process process = null; try { // Linux下的命令 显示或设置网络设备 process = Runtime.getRuntime().exec("ifconfig"); // 显示信息中包含有 MAC 地址信息 bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null; int index = -1; while ((line = bufferedReader.readLine()) != null) { Pattern pat = Pattern.compile(REGEX); Matcher mat = pat.matcher(line); if (mat.find()) { mac = mat.group(0); } } } catch (IOException e) { log.error("获取 Linux MAC 信息错误", e); } finally { try { if (bufferedReader != null) { bufferedReader.close(); } } catch (IOException e1) { log.error("获取 Linux MAC 信息错误", e1); } bufferedReader = null; process = null; } return mac; } /** * 获取 Windows 的 CPU 序列号 * * @return String - CPU 序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getWindowsProcessorIdentification() { String result = ""; try { File file = File.createTempFile("tmp", ".vbs"); file.deleteOnExit(); FileWriter fw = new java.io.FileWriter(file); String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + " (\"Select * from Win32_Processor\") \n" + "For Each objItem in colItems \n" + " Wscript.Echo objItem.ProcessorId \n" + " exit for ' do the first cpu only! \n" + "Next \n"; fw.write(vbs); fw.close(); Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath()); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while ((line = input.readLine()) != null) { result += line; } input.close(); file.delete(); } catch (Exception e) { log.error("获取 Windows CPU 信息错误", e); } return result.trim(); } /** * 获取 Linux 的 CPU 序列号 * * @return String - CPU 序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ private static String getLinuxProcessorIdentification() { String result = ""; String CPU_ID_CMD = "dmidecode"; BufferedReader bufferedReader = null; Process p = null; try { // 管道 p = Runtime.getRuntime().exec(new String[]{"sh", "-c", CPU_ID_CMD}); bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = null; int index = -1; while ((line = bufferedReader.readLine()) != null) { index = line.toLowerCase().indexOf("uuid"); if (index >= 0) { result = line.substring(index + "uuid".length() + 1).trim(); break; } } } catch (IOException e) { log.error("获取 Linux CPU 信息错误", e); } return result.trim(); } /** * 获取当前计算机操作系统名称 例如:windows,Linux,Unix等. * * @return String - 计算机操作系统名称 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ public static String getOSName() { return System.getProperty("os.name").toLowerCase(); } /** * 获取当前计算机操作系统名称前缀 例如:windows,Linux,Unix等. * * @return String - 计算机操作系统名称 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ public static String getOSNamePrefix() { String name = getOSName(); if (name.startsWith(WINDOWS)) { return WINDOWS; } else if (name.startsWith(LINUX)) { return LINUX; } else if (name.startsWith(UNIX)) { return UNIX; } else { return CommonConstant.EMPTY; } } /** * 获取当前计算机主板序列号 * * @return String - 计算机主板序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ public static String getMainBoardSerialNumber() { switch (getOSNamePrefix()) { case WINDOWS: return getWindowsMainBoardSerialNumber(); case LINUX: return getLinuxMainBoardSerialNumber(); default: return CommonConstant.EMPTY; } } /** * 获取当前计算机网卡的 MAC 地址 * * @return String - 网卡的 MAC 地址 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ public static String getMACAddress() { switch (getOSNamePrefix()) { case WINDOWS: return getWindowsMACAddress(); case LINUX: String macAddressForEth0 = getLinuxMACAddressForEth0(); if (ConvertUtils.isEmpty(macAddressForEth0)) { macAddressForEth0 = getLinuxMACAddress(); } return macAddressForEth0; default: return CommonConstant.EMPTY; } } /** * 获取当前计算机的 CPU 序列号 * * @return String - CPU 序列号 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/10 17:15 */ public static String getCPUIdentification() { switch (getOSNamePrefix()) { case WINDOWS: return getWindowsProcessorIdentification(); case LINUX: return getLinuxProcessorIdentification(); default: return CommonConstant.EMPTY; } } /** * 获取计算机唯一标识 * * @return ComputerUniqueIdentification - 计算机唯一标识 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/14 8:50 */ public static ComputerUniqueIdentification getComputerUniqueIdentification() { return new ComputerUniqueIdentification(getOSNamePrefix(), getMainBoardSerialNumber(), getMACAddress(), getCPUIdentification()); } /** * 获取计算机唯一标识 * * @return String - 计算机唯一标识 * @author XinLau * @creed The only constant is change ! ! ! * @since 2020/10/14 8:50 */ public static String getComputerUniqueIdentificationString() { return getComputerUniqueIdentification().toString(); } /** * 计算机唯一标识 */ @Data private static class ComputerUniqueIdentification { private String namePrefix; private String mainBoardSerialNumber; private String MACAddress; private String CPUIdentification; public ComputerUniqueIdentification(String namePrefix, String mainBoardSerialNumber, String MACAddress, String CPUIdentification) { this.namePrefix = namePrefix; this.mainBoardSerialNumber = mainBoardSerialNumber; this.MACAddress = MACAddress; this.CPUIdentification = CPUIdentification; } @Override public String toString() { return new StringBuilder().append('{') .append("\"namePrefix=\":\"").append(namePrefix).append("\",") .append("\"mainBoardSerialNumber=\":\"").append(mainBoardSerialNumber).append("\",") .append("\"MACAddress=\":\"").append(MACAddress).append("\",") .append("\"CPUIdentification=\":\"").append(CPUIdentification) .append("\"}").toString(); } } }
-
获取客户端唯一标识码
2017-04-14 11:59:26在项目中我们通常会用到手机的唯一标识码传给服务器用于统计用户量什么的,我们有可能使用手机的IMEI或者AndroidID、Mac地址等之类的作为标识,但是这些标识对于有的手机可能获取不到导致唯一标识上传失败,这一类的...在项目中我们通常会用到手机的唯一标识码传给服务器用于统计用户量什么的,我们有可能使用手机的IMEI或者AndroidID、Mac地址等之类的作为标识,但是这些标识对于有的手机可能获取不到导致唯一标识上传失败,这一类的问题我们应该都遇到过,这类问题其实也简单,那就是把IMEI,AndroidID,Mac地址等结合然后通过加密进行上传,三种标识相结合,总有一种会存在,所以不用怕获取不到唯一标识,下面是我在网上看到的一种方法,在这里记录下,也希望能帮到大家:
public static String getDevUUid(){ Context context = BaseAplication.getInstance(); String imei = ""; String androidId = ""; String macAddress = ""; TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(TELEPHONY_SERVICE); if (telephonyManager != null) { imei = telephonyManager.getDeviceId(); Log.e("imei---",imei); } ContentResolver contentResolver = context.getContentResolver(); if (contentResolver != null) { androidId = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID); Log.e("androidId---",androidId); } WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { macAddress = wifiManager.getConnectionInfo().getMacAddress(); Log.e("macAddress---",macAddress); } StringBuilder uidBuilder = new StringBuilder(); if (imei != null) { uidBuilder.append(imei); } if (androidId != null) { uidBuilder.append(androidId); } if (macAddress != null) { uidBuilder.append(macAddress); } return toMd5(uidBuilder.toString()); }
/** * 加密 * @param plaintext 明文 * @return ciphertext 密文 */ public final static String toMd5(String plaintext) { char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; try { byte[] btInput = plaintext.getBytes(); // 获得MD5摘要算法的 MessageDigest 对象 MessageDigest mdInst = MessageDigest.getInstance("MD5"); // 使用指定的字节更新摘要 mdInst.update(btInput); // 获得密文 byte[] md = mdInst.digest(); // 把密文转换成十六进制的字符串形式 int j = md.length; char str[] = new char[j * 2]; int k = 0; for (int i = 0; i < j; i++) { byte byte0 = md[i]; str[k++] = hexDigits[byte0 >>> 4 & 0xf]; str[k++] = hexDigits[byte0 & 0xf]; } return new String(str); } catch (Exception e) { return null; } }
-
java怎么获取电脑的唯一标识?
2018-02-25 04:57:12mac地址不可,出现多网卡,虚拟网卡;cpu序列号也不行同一批电脑配置相同返回的信息一样 -
JAVA获取硬件唯一标识,CPU+MAC
2020-08-17 10:47:47现在选取当前主机唯一标识——CPU序列,本篇说下LINUX系统和WINSOWS系统获取CPU序列,顺带说下MAC地址的方法。 思路 主要思路就是使用Runtime.getRuntime().exec()执行命令来获取参数。毕竟是Java代码,要考虑多个...初衷
结合上一篇博文,我需要拿到一台主机的唯一标识,并且这个标识是不可修改的,经查阅发现,MAC地址虽然是唯一标识,但是可修改,所以不可采用。现在选取当前主机唯一标识——CPU序列,本篇说下LINUX系统和WINSOWS系统获取CPU序列,顺带说下MAC地址的方法。
思路
主要思路就是使用Runtime.getRuntime().exec()执行命令来获取参数。毕竟是Java代码,要考虑多个平台的问题,而且linux和windows系统的命令又不同,所以分出处理。不多说,直接上代码:
/** * 获取当前系统CPU序列,可区分linux系统和windows系统 */ public static String getCpuId() throws Exception { String cpuId; // 获取当前操作系统名称 String os = System.getProperty("os.name"); os = os.toUpperCase(); System.out.println(os); // linux系统用Runtime.getRuntime().exec()执行 dmidecode -t processor 查询cpu序列 // windows系统用 wmic cpu get ProcessorId 查看cpu序列 if ("LINUX".equals(os)) { cpuId = getLinuxCpuId("dmidecode -t processor | grep 'ID'", "ID", ":"); } else { cpuId = getWindowsCpuId(); } return cpuId.toUpperCase().replace(" ", ""); } /** * 获取linux系统CPU序列 */ public static String getLinuxCpuId(String cmd, String record, String symbol) throws Exception { String execResult = executeLinuxCmd(cmd); String[] infos = execResult.split("\n"); for (String info : infos) { info = info.trim(); if (info.indexOf(record) != -1) { info.replace(" ", ""); String[] sn = info.split(symbol); return sn[1]; } } return null; } public static String executeLinuxCmd(String cmd) throws Exception { Runtime run = Runtime.getRuntime(); Process process; process = run.exec(cmd); InputStream in = process.getInputStream(); BufferedReader bs = new BufferedReader(new InputStreamReader(in)); StringBuffer out = new StringBuffer(); byte[] b = new byte[8192]; for (int n; (n = in.read(b)) != -1; ) { out.append(new String(b, 0, n)); } in.close(); process.destroy(); return out.toString(); } /** * 获取windows系统CPU序列 */ public static String getWindowsCpuId() throws Exception { Process process = Runtime.getRuntime().exec( new String[]{"wmic", "cpu", "get", "ProcessorId"}); process.getOutputStream().close(); Scanner sc = new Scanner(process.getInputStream()); sc.next(); String serial = sc.next(); return serial; }
-
获取访问者唯一标识
2020-10-12 17:37:46项目有需求,登录前有匿名举报功能,为了避免恶意举报,需标识出访问者进行控制或封禁。首先想到的是获取mac地址,网上资料很多,大体有这几种方案: 获取mac地址 通过浏览器获取 浏览器或是利用ActiveX,目前只有... -
Java HTTPS客户端证书认证
2021-02-26 17:01:59该客户端的密钥库是一个PKCS#12格式文件包含客户端的公共证书(在这种情况下,由自签名CA签名)客户端的私有密钥为了生成它,我使用了OpenSSL的pkcs12命令。openssl pkcs12 -export -in client.crt -inkey client.key... -
Android 获取手机唯一识别码
2021-03-17 12:47:33【实例简介】得到手机唯一识别码【实例截图】【核心代码】private String ChuanMa() {String szImei;// imei码String m_szDevIDShort;String m_szAndroidID;// 安卓idString m_szWLANMAC;// mac地址String m_szBTMAC... -
唯一标识 Java 运行的实例
2021-03-09 08:30:47可以实现唯一标识,同一机器可以可以部署同一个应用多个实例.不受重启的影响,实例标识能够沿用到应用的整个生命周期.避免标识爆炸.获取运行 IP如下可以获取运行的 ip 地址,获取一次即可缓存,无需每次获取.private ... -
javascript 识别客户端唯一性
2018-10-06 09:47:19实现思路打算: 前端页面,ajax 直接传递一些相关参数,记录到 mysql 中,然后后台分析... mysql 字段: ... unique_id - 唯一标识 path - 访问页面路径 user_agent - 记录用户的完成... -
Java Socket编程
2021-02-28 09:00:25Java最初是作为网络编程语言出现的,其对网络提供了高度的支持,使得客户端和服务器的沟通变成了现实,而在网络编程中,使用最多的就是Socket。Socket编程一、网络基础知识1、两台计算机间进行通讯需要以下三个条件... -
Java SpringMVC web项目如何获取手机的唯一标识
2015-10-11 03:00:56请问如何在java后台通过HttpServletRequest或者其他方法获取到手机的唯一标识,而且所有手机都是连上了同一个路由器的局域网的;同时为了防止同学 用电脑签到,最好能判断客户端的操作系统类型。 -
Java request获取客户端ip,各种apach,nginx等代理后依然正确
2017-02-22 17:15:15在JSP,Java里,获取客户端的IP地址的方法是:request.getRemoteAddr() ,这种方法在大部分情况下都是有效的。但是,如果使用了反向代理软件Apache,Squid,nginx等后,就不能获取到客户端的真实IP地址了。 最近我便是... -
微信小程序使用spring boot获取用户唯一标识openId
2018-10-30 14:25:471.app.js里面调用wx.login(OBJECT) 获取登录凭证(code)进而换取用户登录态信息,包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)等。 //app.js App({ onLaunch: function() { //调用API从... -
android studio获取设备唯一标识
2021-12-23 10:25:301.MainActivity import android.provider.Settings.Secure; String android_id = Secure.getString(getBaseContext().getContentResolver(), Secure.ANDROID_ID);...Log.i("MainActivity","唯一标示=="+android_id); -
Php获取移动设备唯一标识
2021-02-08 22:46:46$mobile_agents = array( 'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac', 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno', 'ipaq','java','jigs','kddi','keji... -
Java实现的license生成器
2019-04-25 11:25:57用Java实现license的生成器,包括Java源码以及图形化界面 -
JAVA实现网络客户端和服务端简单通信1(逐渐加深)详细
2022-05-02 17:09:331、IP地址:唯一标识网络上的每一台计算机两台计算机之间通信的必备要素 2、端口号:计算机中应用的标号(代表一个应用程序) 0-1024系统使用或保留端口 , 有效端口0-65536 3、通信协议:通信的规则TCP,UDP 1.创建... -
java Socket
2021-02-28 08:59:39为了完成不同主机的通信,我们需要某种方式来唯一标识一台主机,这个标识,就是著名的IP地址。通过IP地址,IP 协议就能够帮我们把一个数据包发送给对方。TCP前面我们说过,IP 协议提供了主机和主机间的通信。TCP ... -
web在浏览器端如何获取一个唯一的设备标识
2016-10-17 04:50:44(java)web在浏览器端如何获取一个唯一的设备标识,可以使用JS flash等方法, 不受浏览器限制(所以不能通过activeX获取mac地址的方法), fingerprintJS/fingerprintJS2、canvas获取的是浏览器指纹,换浏览器就变,... -
Unity获取手机设备唯一标识-方案探讨
2020-07-18 10:59:47讲解当前环境下 获取安卓手机设备唯一标识的可行方案, 分析优劣势以及容易踩的坑. 前言 公司开发的游戏需要对用户设备进行标识,获得一个稳定可靠并且唯一的识别码,来作游客登录。并考虑后续玩家从游客换成账户登录... -
JAVA获取CPUID、主板序列号、硬盘序列号、MAC地址
2018-05-08 22:10:13最近在修改公司licence程序,需要获取到更多的硬件唯一标识,以便加密使用。网上看了很多大神的博客,思路大概整理了一下,根据系统类型分为两种方式:一、windows通过创建vbs脚本,然后使用Runtime.getRuntime().exec... -
java生成唯一的UUID码
2011-11-09 20:51:27UUID是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的。通常平台会提供生成的API。按照开放软件基金会(OSF)制定的标准计算,用到了以太网卡地址、纳秒级时间、芯片ID码和许多可能的数字 ... -
获取B/S客户端IP
2013-03-30 13:31:50java浏览器Web编程JSP ...对于C/S架构的聊天系统,由于存在客户端Java应用,所以直接在代码中获取客户端的IP,应用的方法为: String ip = InetAddress.getLocalHost().getHostAddress(); 然而对于 -
Java关于Http请求的各种参数或行为的获取
2022-05-06 09:37:10HttpServletRequest的作用及用法 ... 方法声明 功能描述 String getMethod() 该方法用于获取 HTTP 请求消息中的请求方式(如 GET、POST 等) ... 该方法用于获取请求行中的参数部分,也就... -
javaNetty基于NIO实现多客户端TCPSocket网络通信
2021-11-04 09:15:12java 异步通信NIO非阻塞流实现多客户端通信 服务器: //开启服务器 public void StratServer() throws IOException { //创建服务端通道 ServerSocketChannel serverSocketChannel = ServerSocketChannel.open(); ... -
Java后台防止客户端重复请求、提交表单实现原理
2021-03-13 21:16:26这篇文章主要介绍了Java后台防止客户端重复请求、提交表单实现原理,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下前言在Web / App项目中,有一些请求或操作会... -
生成唯一ID的四种办法 程序员必备
2021-03-10 08:42:03我们在实际编程过程中会经常遇到需要用唯一ID的场合,这些唯一ID还会存到数据库中以便于我们将来进行查询。例如用户编号、订单编号、客户编号等等,几乎凡是需要用来严格划分用户数据归属性的地方就需要用到唯一ID,... -
通过java客户端给K8s节点机打标签
2017-08-22 15:43:46通过java来实现指定节点机启动服务/组件/产品,具体是通过fabric8io/kubernetes.client来实现