Zxing.net is an open source project maintained by Google. Used to generate QR codes on the. NET platform, and of course there are many other uses.
Install commands with NuGet
Install-package zxing.net
Then add the namespace:
using ZXing; using Zxing.common; using zxing.rendering;
Generate a link to the address of the demo, the demo of the Baidu link to the address you want any character content can be.
Static voidMain (string[] args) {Barcodewriter Barcodewriter=NewBarcodewriter (); Barcodewriter.format=Barcodeformat.qr_code; Barcodewritergeneric<Bitmap> Arg_50_0 =Barcodewriter; Encodingoptions arg_50_1; Arg_50_1=Newencodingoptions {Height= -, Width= - }; Arg_50_0.options=arg_50_1; Barcodewriter writer=Barcodewriter; varBitmap = writer. Write ("http://www.baidu.com"); Bitmap. Save ("Qr-code.png", System.Drawing.Imaging.ImageFormat.Png); }
This is a console program, under the Bin/debug can be found qr-code.png this generated QR code.
The generated Baidu home QR code is as follows:
With your sweep, you can open Baidu.
Two-dimensional code generation Zxing.net DEMO