Myeclipse 6.0 注册码生成器代码

[java]  view plain copy
  1. import java.io.*;  
  2. /* 
  3.  *Myeclipse6.0_KeyMaker 
  4.  *Myeclipse6.0注册码生成器  
  5.  *丰衣足食,自给自足! 
  6.  */  
  7. public class MyEclipseGen {  
  8.     private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";     
  9.     public String getSerial(String userId, String licenseNum) {     
  10.         java.util.Calendar cal = java.util.Calendar.getInstance();     
  11.         cal.add(13);     
  12.         cal.add(6, -1);     
  13.         java.text.NumberFormat nf = new java.text.DecimalFormat("000");     
  14.         licenseNum = nf.format(Integer.valueOf(licenseNum));     
  15.         String verTime = new StringBuilder("-").append(new java.text.     
  16.                 SimpleDateFormat("yyMMdd").format(cal.getTime())).append("0").     
  17.                          toString();     
  18.         String type = "YE3MP-";     
  19.         String need = new StringBuilder(userId.substring(01)).append(type).     
  20.                       append("300").append(licenseNum).append(verTime).toString();     
  21.         String dx = new StringBuilder(need).append(LL).append(userId).toString();     
  22.         int suf = this.decode(dx);     
  23.         String code = new StringBuilder(need).append(String.valueOf(suf)).     
  24.                       toString();     
  25.         return this.change(code);     
  26.     }     
  27.     private int decode(String s) {     
  28.         int i;     
  29.         char[] ac;     
  30.         int j;     
  31.         int k;     
  32.         i = 0;     
  33.         ac = s.toCharArray();     
  34.         j = 0;     
  35.         k = ac.length;     
  36.         while (j < k) {     
  37.             i = (31 * i) + ac[j];     
  38.             j++;     
  39.         }     
  40.         return Math.abs(i);     
  41.     }     
  42.     private String change(String s) {     
  43.         byte[] abyte0;     
  44.         char[] ac;     
  45.         int i;     
  46.         int k;     
  47.         int j;     
  48.         abyte0 = s.getBytes();     
  49.         ac = new char[s.length()];     
  50.         i = 0;     
  51.         k = abyte0.length;     
  52.         while (i < k) {     
  53.             j = abyte0[i];     
  54.             if ((j >= 48) && (j <= 57)) {     
  55.                 j = (((j - 48) + 5) % 10) + 48;     
  56.             } else if ((j >= 65) && (j <= 90)) {     
  57.                 j = (((j - 65) + 13) % 26) + 65;     
  58.             } else if ((j >= 97) && (j <= 122)) {     
  59.                 j = (((j - 97) + 13) % 26) + 97;     
  60.             }     
  61.             ac[i] = (char) j;     
  62.             i++;     
  63.         }     
  64.         return String.valueOf(ac);     
  65.     }     
  66.     public MyEclipseGen() {     
  67.         super();     
  68.     }     
  69.     public static void main(String[] args) {     
  70.         try {     
  71.             System.out.println("please input register name:");     
  72.             BufferedReader reader = new BufferedReader(new InputStreamReader(     
  73.                     System.in));     
  74.             String userId = null;     
  75.             userId = reader.readLine();     
  76.             MyEclipseGen myeclipsegen = new MyEclipseGen();     
  77.             String res = myeclipsegen.getSerial(userId, "20");     
  78.             System.out.println("Serial:" + res);     
  79.             reader.readLine();     
  80.         } catch (IOException ex) {     
  81.         }     
  82.     }     
  83. }   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值