- 浏览: 691343 次
- 来自: ...
文章分类
最新评论
-
ranguisheng:
可以加点注释,代码不便于阅读.
用java实现数据库连接池的一个简单示例 -
abcd880129:
这样写的话,还要用专门的下载工具,不然,只能下到一个为空的ex ...
ZK下载文件时,不在服务器生成文件直接下载 -
234369425:
同上,是20
java计算阶乘 -
CodeToMyLaw:
如果目录中含有中文呢?
[^\x00-\xff] 中文的 ...
js验证文件目录格式的正确性 -
yanzhoupuzhang:
加了,还是报那个错误!
org.apache.commons.dbcp.BasicDataSource的解决方法
package com.springemail; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class MyEclipseKeyGenforSpring { private static final String LL = "Decompilingthiscopyrighted 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 type) { NumberFormat nf = new DecimalFormat("000"); Calendar cal = Calendar.getInstance(); cal.add(Calendar.YEAR, 3); cal.add(Calendar.DAY_OF_YEAR, -1); String licenseNum = nf.format((int) (Math.random() * 1000)); String expTime = new StringBuilder("-").append( new SimpleDateFormat("yyMMdd").format(cal.getTime())).append( "0").toString(); String need = new StringBuilder(userId.substring(0, 1)).append("Y") .append(type).append("-100").append(licenseNum).append(expTime) .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 static void main(String[] args) { try { System.out.print("输入注册名:"); BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); String userId = null; userId = reader.readLine(); if (userId == null || "".equals(userId)) { System.out.println("name is null"); System.exit(0); } MyEclipseKeyGenforSpring myeclipsegen = new MyEclipseKeyGenforSpring(); String res = myeclipsegen.getSerial(userId, "E3MS"); System.out.println("得到的注册码:" + res); reader.readLine(); } catch (IOException ex) { ex.printStackTrace(); } } }
发表评论
-
Json,Gson,FastJson解析笔记
2015-06-13 17:31 835Json 1.将JavaBean转换成Json对象: pu ... -
String与InputStream互转的几种方法
2015-06-13 17:24 631/** * 利用BufferedReader ... -
Java压缩图片
2015-06-06 15:49 1079package com.yipai.ut ... -
HashMap的工作原理
2013-11-18 22:58 803本文由 ImportNew - 唐小娟 翻译自 Javarev ... -
一道多线程题目的解决方案
2013-08-03 17:24 756在iteye上看到的一道多线程的题目,参考了一下网友的实现,那 ... -
java socket 多线程网络传输多个文件
2013-06-25 14:57 839由于需要研究了下用 java socket 传输文件,由于需要 ... -
处理大数字
2011-04-30 13:40 977/** * 处理大数字 * & ... -
生成随机数
2011-04-30 13:39 1194/** * 生成随机数 */ public cl ... -
转换数字的进制
2011-04-30 13:38 1281/** * * 转换数字的进制 */ pu ... -
数字的舍入
2011-04-30 13:37 1076/** * 数字的舍入 * */ publi ... -
格式化数字
2011-04-30 13:36 1138/** * 格式化数字的输出 * */ pu ... -
数字与其封装类之间的转换
2011-04-30 13:16 813/** * * 数字与其封装类之间的转换 * ... -
Adapter适配器模式
2011-04-24 21:38 831/** * Adapter适配器模式<br> ... -
Factory工厂模式
2011-04-24 21:36 859/** * 模式名称:工厂模式 * 模式特征:通过 ... -
Singleton单例模式
2011-04-24 21:35 959public class SingletonA { ... -
排序类
2011-04-24 20:38 977/** * 定义数字排序的 ... -
方法和变量在继承时的覆盖与隐藏
2011-04-24 20:30 943public class Parent2 { // ... -
类的加载顺序
2011-04-24 20:27 826/** * 父类 * */ public ... -
自定义形状类(继承的运用)
2011-04-10 17:18 1074/** * * 自定义图形的基类 */ p ... -
单例模式简单例子
2010-09-01 18:02 1315package test.singleton; /* ...
相关推荐
Myeclipse 8.6注册码 Myeclipse 8.6注册码
myeclipse8.6注册码 1.myeclipse8成功激活
myeclipse8.6注册码. 注册机
MyEclipse 8.6 注册码.txtMyEclipse 8.6 注册码.txtMyEclipse 8.6 注册码.txtMyEclipse 8.6 注册码.txt
MyEclipse 8.6生成器可以随机生成MyEclipse 8.6注册所需的注册码,大家再也不用到网上无聊的搜索了,自己生成自己用。
myeclipse8.6 注册码 可以用到2019年
MyEclipse8.6注册码MyEclipse8.6注册码MyEclipse8.6注册码
Myeclipse8.6注册码
将文档中的代码复制进去后,运行,即可获取Myeclipse8.6的注册码
myeclipse 8.6英文 正版 注册码
注册方法: window -> preferences -> myeclipse -> subscription
解压MyEclipse8.6RegisterCode后,用MyEclipse导入java程序!然后运行! 提示please input register name: 输入用户名 jt不一定要jt可以输入自己喜欢和好记忆的名字然后按Enter即出注册码 然后就出注册码! Serial:...
Myeclipse8.6注册方法,:将此段代码运行,即可以生成Myeclipse8.6注册码
一个java代码 能生成MyEclipse注册码,本人试过生成的MyEclipse8.6版本能有,据说能用到2016年本人2014年4月份使用过能用