此功能适用于商业产品的授权问题,一台电脑一款软件,费话不说,上代码:
///==============================获取CPU序列号========
package com.test;
import java.io.IOException;
import java.util.Scanner;
public class CpuUtil {
public static void main(String[] args) throws
IOException {
long start =
System.currentTimeMillis();
Process process =
Runtime.getRuntime().exec(
new
String[] { "wmic", "cpu", "get", "ProcessorId" });
process.getOutputStream().close();
Scanner sc = new
Scanner(process.getInputStream());
String property =
sc.next();
String serial =
sc.nex