|  |  | 
 |  |  |     Linux("Linux", null), | 
 |  |  |     Mac_OS("Mac OS", null), | 
 |  |  |     Mac_OS_X("Mac OS X", null), | 
 |  |  |     Windows("Windows", "D:\\激活码.txt"), | 
 |  |  |     Windows("Windows", "D:\\WMS系统激活码(请勿删除).txt"), | 
 |  |  |     OS2("OS/2", null), | 
 |  |  |     Solaris("Solaris", null), | 
 |  |  |     SunOS("SunOS", null), | 
 
 |  |  | 
 |  |  | package com.zy.common.properties; | 
 |  |  |  | 
 |  |  | import com.core.common.AesUtils; | 
 |  |  | import com.core.common.DateUtils; | 
 |  |  |  | 
 |  |  | import java.io.*; | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * Created by vincent on 2020/8/1 | 
 |  |  | 
 |  |  |             } | 
 |  |  |             f.close(); | 
 |  |  |             buf.close(); | 
 |  |  |         } catch (FileNotFoundException ignore) { | 
 |  |  |  | 
 |  |  |         } catch (IOException e) { | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("读取WMS系统激活码失败!!!\n读取路径 " + fileName); | 
 |  |  | 
 |  |  |  | 
 |  |  |     // 生成激活码 | 
 |  |  |     public static void main(String[] args) { | 
 |  |  |         String code = AesUtils.encrypt("20200801152500", SystemProperties.SALT); | 
 |  |  |         System.out.println(code); | 
 |  |  |         String timeStr = "2020-08-01 17:15:35"; | 
 |  |  |         Date exprTime = DateUtils.convert(timeStr); | 
 |  |  |         String code = AesUtils.encrypt(DateUtils.convert(exprTime, DateUtils.yyyyMMddHHmmss), SystemProperties.SALT); | 
 |  |  |         System.out.println("激活码:"+code); | 
 |  |  |         System.out.println("有效期至:"+timeStr); | 
 |  |  | //        saveActivationCode(SysOsType.Windows.getActivationCodePath(), code); | 
 |  |  | //        String activationCode = getActivationCode(OSinfo.getOSname().getActivationCodePath()); | 
 |  |  | //        String decrypt = AesUtils.decrypt(activationCode, "123456789qwertyu"); |