Normal use the following code to do the required jar package, free points: 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);
Store picture Path
String Imgpath = "E:/tddownload/michael_qrcode" +string+ ". png";
Two-dimensional code content
String encodercontent = "Hello, this is the two-dimensional code generation case";
Call Twodimensioncode
Twodimensioncode handler = new Twodimensioncode ();
Handler.encoderqrcode (Encodercontent, Imgpath, "PNG");
System.out.println ("========encoder success");
Analytical
String decodercontent = Handler.decoderqrcode (Imgpath);
System.out.println ("Parse the result as follows:");
System.out.println (decodercontent);
System.out.println ("========decoder success!!!");
}
}
Java Two-dimensional code generation