Download ThoughtWorks.QRCode.dll extract from the Internet to find a lot of versions, decisive choice of the latest version
Code to generate a QR code
Private Bitmap GetCode (string code) { Qrcodeencoder qrcodeencoder = new Qrcodeencoder (); Set the QR Code encoding format Qrcodeencoder.qrcodeencodemode = Qrcodeencoder.encode_mode. BYTE; Set the encoding measurement Qrcodeencoder.qrcodescale = code. Length; Set encoding version qrcodeencoder.qrcodeversion = 7; Set error check Qrcodeencoder.qrcodeerrorcorrect = qrcodeencoder.error_correction. M; Bitmap img = Qrcodeencoder.encode ("123456789"); return img;}
But in the Qrcodeencoder.encode has been a group of cross-border errors, search online after the ThoughtWorks.QRCode.dll version, to find the latest version of the file is very small, and then changed 1.0.2774.19990 version, to run, success!
Qrcodeencoder.encode array out of bounds