文件名称:C#中QR二维码的dll文件
文件大小:5.92MB
文件格式:DLL
更新时间:2016-12-09 03:23:01
QR c#
直接添加引用即可,并使用以下代码 //二维码生成部分 QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); String encoding = "Byte"; //cboEncoding.Text; if (encoding == "Byte") { qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; } else if (encoding == "AlphaNumeric") { qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.ALPHA_NUMERIC; } else if (encoding == "Numeric") { qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.NUMERIC; } try { //int scale = Convert.ToInt16(txtSize.Text); int scale = 1; qrCodeEncoder.QRCodeScale = scale; } catch (Exception ex) { MessageBox.Show("Invalid size!"); return; } try { //设定二维码版本 int version = 40;// Convert.ToInt16(cboVersion.Text); qrCodeEncoder.QRCodeVersion = version; } catch (Exception ex) { MessageBox.Show("Invalid version !"); } //string errorCorrect = cboCorrectionLevel.Text; //设置二维码纠错版本 string errorCorrect = "L"; if (errorCorrect == "L") qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.L; else if (errorCorrect == "M") qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; else if (errorCorrect == "Q") qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.Q; else if (errorCorrect == "H") qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.H; //生成二维码图片 Image image = qrCodeEncoder.Encode(data, Encoding.GetEncoding("gb2312")); //生成二维码文件 CreateQRFile(data, image, supplierName, DeliveryDate,QRNo);