正常使用下面代码做需要的jar包,免积分下载地址:http://download.csdn.net/detail/zihan11201120/4969485
package com.zihan.org;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import qrcode.TwoDimensionCode;
public class nihao {
/**
* @param args
* @author ZIHAN
* @date 2013-1-7
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Date aDate = new Date();
String string = null;
DateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
string= simpleDateFormat.format(aDate);
//存放图片路径
String imgPath = "e:/TDDOWNLOAD/Michael_QRCode"+string+".png";
//二维码内容
String encoderContent = "你好,这是二维码生成案例";
//调用TwoDimensionCode
TwoDimensionCode handler = new TwoDimensionCode();
handler.encoderQRCode(encoderContent, imgPath, "png");
System.out.println("========encoder success");
//解析
String decoderContent = handler.decoderQRCode(imgPath);
System.out.println("解析结果如下:");
System.out.println(decoderContent);
System.out.println("========decoder success!!!");
}
}