代码示例:
package com.wbf.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MyEclipseGen { 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."; public String getSerial(String userId, String licenseNum) { java.util.Calendar cal = java.util.Calendar.getInstance(); cal.add(1, 3); cal.add(6, -1); java.text.NumberFormat nf = new java.text.DecimalFormat("000"); licenseNum = nf.format(Integer.valueOf(licenseNum)); String verTime = new StringBuilder("-").append( new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime())) .append("0").toString(); String type = "YE3MP-"; String need = new StringBuilder(userId.substring(0, 1)).append(type) .append("300").append(licenseNum).append(verTime).toString(); String dx = new StringBuilder(need).append(LL).append(userId) .toString(); int suf = this.decode(dx); String code = new StringBuilder(need).append(String.valueOf(suf)) .toString(); return this.change(code); } private int decode(String s) { int i; char[] ac; int j; int k; i = 0; ac = s.toCharArray(); j = 0; k = ac.length; while (j < k) { i = (31 * i) + ac[j]; j++; } return Math.abs(i); } private String change(String s) { byte[] abyte0; char[] ac; int i; int k; int j; abyte0 = s.getBytes(); ac = new char[s.length()]; i = 0; k = abyte0.length; while (i < k) { j = abyte0[i]; if ((j >= 48) && (j <= 57)) { j = (((j - 48) + 5) % 10) + 48; } else if ((j >= 65) && (j <= 90)) { j = (((j - 65) + 13) % 26) + 65; } else if ((j >= 97) && (j <= 122)) { j = (((j - 97) + 13) % 26) + 97; } ac[i] = (char) j; i++; } return String.valueOf(ac); } public MyEclipseGen() { super(); } public static void main(String[] args) { try { System.out.println("please input register name:"); BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); String userId = null; userId = reader.readLine(); MyEclipseGen myeclipsegen = new MyEclipseGen(); String res = myeclipsegen.getSerial(userId, "5"); System.out.println("Serial:" + res); reader.readLine(); } catch (IOException ex) { } } }
运行结果:
please input register name:
wbf
Serial:jLR8ZC-855550-62585856129738048
相关推荐
MyEclipse 6.5和8.5是两个不同的版本,它们分别发布于2008年和2010年。6.5版增加了对Java EE 5的支持,改进了代码提示和重构功能,同时增强了数据库工具。8.5版则进一步升级,支持了Java EE 6规范,提供了更完善的...
myeclipse-8.5M1-win32.part14 myeclipse-8.5M1-win32.part14 myeclipse-8.5M1-win32.part14
myeclipse-8.5M1-win32.part13 myeclipse-8.5M1-win32.part13 myeclipse-8.5M1-win32.part13
MyEclipse6.5自动生成序列号注册机源码
myeclipse-8.5M1-win32.part35 myeclipse-8.5M1-win32.part35 myeclipse-8.5M1-win32.part35
myeclipse-8.5M1-win32.part55 myeclipse-8.5M1-win32.part55 myeclipse-8.5M1-win32.part55
MyEclipse 6.5+8.5+8.6里代码自动提示设置
MyEclipse5.5-8.5注册码,MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码MyEclipse5.5-8.5注册码...
标题中的"MyEclipse 6.5-8.6注册码"指的是适用于MyEclipse 6.5至8.6版本的一组激活码或序列号,这些版本涵盖了从2007年至2011年间的多个软件发行版。MyEclipse的各个版本都有其独特的特性和改进,随着版本的升级,...
**标题:“Axis2-myeclipse6.5-plugin1.3.0”** **描述:“Axis2插件,里面有安装说明,很简单。”** 本文将详细解析标题“Axis2-myeclipse6.5-plugin1.3.0”以及描述中提到的Axis2插件,包括其在MyEclipse 6.5中...
本人电脑安装时Myeclipse6.5,安装到了C盘,放在了C:\Program Files\MyEclipse 6.5\myeclipse\eclipse\plugins 这个目录下即可。 2, 重新启动eclipse 3, 打开eclipse->window->Preferences,搜索关键字find bugs,...
myeclipse-8.5M1-win32.part31 myeclipse-8.5M1-win32.part31 myeclipse-8.5M1-win32.part31
myeclipse-8.5M1-win32.part44 myeclipse-8.5M1-win32.part44 myeclipse-8.5M1-win32.part44
myeclipse-8.5M1-win32.part54 myeclipse-8.5M1-win32.part54 myeclipse-8.5M1-win32.part54
myeclipse-8.5M1-win32.part40 myeclipse-8.5M1-win32.part40 myeclipse-8.5M1-win32.part40
MyEclipse 7.5-8.5通用注册码
myeclipse-8.5M1-win32.part04 myeclipse-8.5M1-win32.part04 myeclipse-8.5M1-win32.part04
myeclipse-8.5M1-win32.part26 myeclipse-8.5M1-win32.part26 myeclipse-8.5M1-win32.part26
myeclipse-8.5M1-win32.part18 myeclipse-8.5M1-win32.part18 myeclipse-8.5M1-win32.part18
myeclipse-8.5M1-win32.part02 myeclipse-8.5M1-win32.part02 myeclipse-8.5M1-win32.part02