需要用到的 dll
添加引用
代码:
//获取配置文件设置的url
string urllink = ConfigurationManager.AppSettings["urllink"].ToString();
//转换成 链接
string link = "http://www.baidu.com"
//生成二维码
Bitmap asdasd = GetQRCodeByZXingNet(link);
//二维码图片 bitmap的基类是 image 所以进行强制转换
Image photoImg = asdasd as Image;
//转换成 bute[]
byte[] erjinzhi = GetByteImage(photoImg);
//新增 表 并它设置属性 的字段里面 请注意:此处后面必须为byte[]类型
ds.Tables[0].Columns.Add(" QRcode", typeof(byte[]));
保存
ds.Tables[0].Rows[0