- 博客(1)
- 资源 (3)
- 收藏
- 关注
原创 Dreamver 8软件使用过期后怎么办?
在网上找Dreamver 8序列号,进入Dreamver 8到“购买”页面点击“继续”找到的序列号填写即可
2015-08-17 11:13:21
561
所带来可观
http://www.zhujiangroad.com/program/JAVA/2568.html在 Java 应用程序中访问USB设备
http://blog.sina.com.cn/s/blog_6d95ca170100umu6.html
http://sourceforge.net/projects/jusb/
http://usr.cc/member.php?mod=register
http://qq477768302-sina-com.iteye.com/blog/1668029 加密狗Java的USB算法
http://soft.chinabyte.com/database/52/12057052.shtml
http://blog.csdn.net/zhenanlin/article/details/7902989
http://wenku.baidu.com/view/99c9ccb169dc5022aaea0031.html
http://blog.csdn.net/wangshouh/article/details/19678785
http://blog.csdn.net/zhou_zion/article/details/7714892
2015-06-18
MD5数字1-99999999加密并插入到蒙冤受屈连数据表中
MD5数据加密,数字1-999999999,数据库为mysql
package text;
import java.security.MessageDigest;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
/**
* 采用MD5加密
*/
public class MD5Util {
/***
* MD5加密 生成32位md5码
* @param 待加密字符串
* @return 返回32位md5码
*/
public static String md5Encode(String inStr) throws Exception {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes("UTF-8");
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
/**
* 测试主函数
* @param args
* @throws Exception
*/
public static void main(String args[]) throws Exception {
// TODO Auto-generated method stub
//连接数据字段
String sConnStr = "jdbc:mysql://localhost:3306/test";
Connection connect = null;
for(int i=0;i<99999999;i++) {
System.out.println("原始:" + i);
String keyname = String.valueOf( i);
String md5name=md5Encode(keyname);
System.out.println("MD5后:" + md5name);
try
{
//将两个字段插入数据表
Statement stmt = null;
String sql="insert into tb(keyname,md5name) values('"+keyname+"','"+md5name.substring(0,32)+"')";
connect = DriverManager.getConnection(sConnStr, "root", "123");
stmt = connect.createStatement();
stmt.executeUpdate(sql);
stmt.close();
connect.close();
} catch (Exception e) {
System.out.println("keyname为"+keyname+"的MD5数据生成错误,不能完成插入!");
}
}
}
}
2015-06-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人