public class SerialUtils { private static Properties props = System.getProperties(); private static String systemName = props.getProperty("os.name"); /** * Windows下获取cpuId * * @return */ public static String getWinCPU() { Process process; String serial = null; try { process = Runtime.getRuntime().exec(new String[] { "wmic", "cpu", "get", "ProcessorId" }); process.getOutputStream().close(); Scanner sc = new Scanner(process.getInputStream()); String property = sc.next(); serial = sc.next(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return serial; } /** * Windows下获取硬盘SN号 * * @return * @throws IOException */ public static String getWinHdSerialInfo() throws IOException { Process process = Runtime.getRuntime().exec(new String[] { "wmic", "diskdrive", "g
获取硬盘序列号、CPU序列号
最新推荐文章于 2024-07-19 17:37:28 发布