package test;  
 
import java.io.BufferedReader;  
import java.io.IOException;  
import java.io.InputStreamReader;  
 
public class MyEclipseKeyGen {  
    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 MyEclipseKeyGen() {  
        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();  
            MyEclipseKeyGen myeclipsekeygen = new MyEclipseKeyGen();  
            String res = myeclipsekeygen.getSerial(userId, "5");  
            System.out.println("Serial:" + res);  
            reader.readLine();  
        } catch (IOException ex) {  
        }  
    }  
}

MyEclipse注册代码的更多相关文章

  1. 怎样增强MyEclipse的代码自动提示功能

    步骤/方法 1 一 般在Eclipse ,MyEclipse代码里面,打个foreach,switch等 这些,是无法得到代码提示的(不信自己试试),其他的就更不用说了,而在Microsoft Vis ...

  2. bing 输入法,切换简体、繁体快捷键与myeclipse 格式化代码冲突。。

    bing 输入法,切换简体.繁体快捷键与myeclipse 格式化代码冲突...蛋碎 myeclipse 代码格式化快捷键是:ctrl+shift+F,bing输入法简体.繁体切换也是,于是蛋疼的事情 ...

  3. 增强Eclipse ,MyEclipse 的代码自动提示功能

    一般默认情况下,Eclipse ,MyEclipse 的代码提示功能是比Microsoft Visual Studio的差很多的,主要是Eclipse ,MyEclipse本身有很多选项是默认关闭的, ...

  4. 增强MyEclipse的代码自动提示功能

      一般在Eclipse ,MyEclipse代码里面,打个foreach,switch等 这些,是无法得到代码提示的(不信自己试试),其他的就更不用说了,而在Microsoft Visual Stu ...

  5. EPF与Myeclipse 增强代码自动智能提示

    摘自: http://blog.csdn.net/ylchou/article/details/7639467 数字证书文件,导入用. EPF文件是著名的软件开发工具——Eclipse(IDE)的配置 ...

  6. GIF Movie Gear逆向实战+注册代码+补丁

    GIF Movie Gear逆向实战+注册代码+补丁 准备 我是在windows 8.1 x64上进行的操作.有不足之处,还望大虾指出. 获取资源 网站下载:http://www.gamani.com ...

  7. MyEclipse的代码自动提示功能

     一般默认情况下,Eclipse ,MyEclipse的代码提示功能是比Microsoft Visual Studio的差很多的,主要是Eclipse ,MyEclipse本身有很多选项是默认关闭的, ...

  8. myeclipse快捷键代码

    复制来源百度文库http://wenku.baidu.com/link?url=2DLLTMdq4q_ZrK1Zqg34ElzDePSLC3qfKxi7P2et7NO-g7JErrYS4Dl8dbtR ...

  9. java-JDBC登录注册代码

    登录: public static void main(String[] args) throws Exception{ Scanner sc = new Scanner(System.in); Sy ...

随机推荐

  1. 【Offer】[30] 【包含min函数的栈】

    题目描述 思路分析 测试用例 Java代码 代码链接 题目描述 定义栈的数据结构,请在该类型中实现一个能够得到栈的最小元素的min函数.在该栈中,调用min.push及pop的时间复杂度都是0(1). ...

  2. 【Offer】[13] 【机器人的运动范围】

    题目描述 思路分析 Java代码 代码链接 题目描述 地上有一个m行和n列的方格.一个机器人从坐标0,0的格子开始移动,每一次只能向左,右,上,下四个方向移动一格,但是不能进入行坐标和列坐标的数位之和 ...

  3. SIA-GateWay之API网关安装部署指南

    SIA-GATEWAY是基于SpringCloud微服务生态体系下开发的一个分布式微服务网关系统.具备简单易用.可视化.高可扩展.高可用性等特征,提供云原生.完整及成熟的接入服务解决方案.本文介绍AP ...

  4. yolo进化史之yolov2

    yolov1和当时最好的目标检测系统相比,有很多缺点.比如和Fast R-CNN相比,定位错误更多.和基于区域选择的目标检测方法相比,recall也比较低.yolov2的目标即在保证分类准确度的情况下 ...

  5. 史上最全 69 道 Spring 面试题和答案

    史上最全 69 道 Spring 面试题和答案 目录Spring 概述依赖注入Spring beansSpring注解Spring数据访问Spring面向切面编程(AOP)Spring MVC Spr ...

  6. 拒绝一次性买卖:MyBatis的mapper和repository可重复生成工具

    背景 MyBatis的历史可谓久远了,码农们也在用着各式各样的代码生成工具.然而这些工具大部分都有一个缺点,那就是只能一次性生成文件.如果我们期间在生成的文件里做了修改,再次生成时,很多工具会覆盖我们 ...

  7. mybatis拦截器实现通用权限字段添加

    实现效果 日常sql中直接使用权限字段实现权限内数据筛选,无需入参,直接使用,使用形式为:select * from crh_snp.channelinfo where short_code in ( ...

  8. 关于Elasticsearch文档的描述以及如何操作文档的详细总结

    文档 什么是文档 在大多数应用中,多数实体或对象可以被序列化为包含键值对的 JSON 对象. 一个 键 可以是一个字段或字段的名称,一个 值 可以是一个字符串,一个数字,一个布尔值, 另一个对象,一些 ...

  9. C#中的根据实体增删改操作

    在日常操作中,我们经常会对一些数据进行批量更新, 我在使用EF的时候,没有找到比较好的批量更新的解决方案, 便参考了张占岭前辈的博客,整合了这么一个简略版的使用实体类生成数据库增删改SQL的操作类 在 ...

  10. apache ignite系列(四):持久化

    ignite持久化与固化内存 1.持久化的机制 ignite持久化的关键点如下: ignite持久化可防止内存溢出导致数据丢失的情况: 持久化可以定制化配置,按需持久化; 持久化能解决在大量缓存数据情 ...