二维码的生成

using ThoughtWorks;

using ThoughtWorks.QRCode;

using ThoughtWorks.QRCode.Codec;

using ThoughtWorks.QRCode.Codec.Data;

using System.Drawing;

 

 

 

Bitmap bt;

 

string enCodeString = “生成二维码的字获取地址”;

 

QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();

 

bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8);

 

bt.Save(Server.MapPath("~/images/") + "beautiful.jpg"); //保存后的地址及生成的图片名称

 

this.Image1.ImageUrl = Server.MapPath("~/images/") + "beautiful.jpg";//标签指向路径

posted @ 2016-05-25 11:54  —阿峰—  阅读(166)  评论(0编辑  收藏  举报