Java Two-dimensional code generation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.