1.添加引用:ThoughtWorks.QRCode.dll
注意:有些DLL对中文支持不好,重新下载
2.添加

using ThoughtWorks.QRCode.Codec;
using ThoughtWorks.QRCode.Codec.Data;
using ThoughtWorks.QRCode.Codec.Util;
3 在页面中添加picturebox
4.在事件中写入:
ThoughtWorks.QRCode.Codec.QRCodeEncoder qr = new QRCodeEncoder();

qr.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;
qr.QRCodeScale = 3;
qr.QRCodeVersion = 5;
qr.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
//以上参数根据需要调
Image img;                  
String Code = “需写入二维码的文本内容”;
img = qr.Encode(Code);
this.pictureBox1.Image = img;

//如果不出现二维码图片,有可能是文本内容超长,自己调下参数!
C# 二维码_中文