Create a new Windows application, add a reference ThoughtWorks.QRCode.dll, and write code to generate the QR code.
usingSystem;usingSystem.Drawing;usingSystem.Windows.Forms;usingThoughtworks.qrcode.codec;namespace qccodecreaterexp{ Public Partial classForm1:form { Public Form1() {InitializeComponent (); }Private void Button1_Click(Objectsender, EventArgs e) {image image;Try{Qrcodeencoder Qrcodeencoder =NewQrcodeencoder (); Qrcodeencoder.qrcodeencodemode = Qrcodeencoder.encode_mode. BYTE; Qrcodeencoder.qrcodescale = Convert.ToInt32 (Textbox_qrcodesize.text);//SizeQrcodeencoder.qrcodeversion = Convert.ToInt32 (Textbox_qrcodeversion.text);//VersionQrcodeencoder.qrcodeerrorcorrect = qrcodeencoder.error_correction. M Image = Qrcodeencoder.encode (Textbox_qrcodecontent.text); }Catch(Exception ex) {image =NULL; }if(Image! =NULL) {picturebox1.image = Image; } } }}
To my blog address to generate two-dimensional code, the following is the run.
Let's get the phone to sweep.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Using Thoughtworks.qrcode to generate two-dimensional code