QR二维码的组件的(C#)

时间:2016-11-01 12:24:36
【文件属性】:

文件名称:QR二维码的组件的(C#)

文件大小:924KB

文件格式:ZIP

更新时间:2016-11-01 12:24:36

QR二维码

可直接在网页内调用该给件生成QR二维码 using System; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ThoughtWorks.QRCode.Codec; //|5|1|a|s|p|x public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; qrCodeEncoder.QRCodeScale = 4; qrCodeEncoder.QRCodeVersion = 5; qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; String data = "身份证号:41071119851778190;身份证号:41071119851778190"; System.Drawing.Bitmap image = qrCodeEncoder.Encode(data);//生成QR码图片 image.Save("D:/" + "sa.gif", System.Drawing.Imaging.ImageFormat.Gif);//保存图片 System.IO.MemoryStream MStream = new System.IO.MemoryStream(); //生成内存流对象 image.Save(MStream, System.Drawing.Imaging.ImageFormat.Gif);//图片转化为内存流 Response.ClearContent(); Response.ContentType = "image/Gif"; Response.BinaryWrite(MStream.ToArray()); } } }


【文件预览】:
WebQRcode
----bin()
--------ThoughtWorks.QRCode.dll(5.92MB)
----Default.aspx(431B)
----App_Data()
----Web.Config(2KB)
----Default.aspx.cs(1KB)

网友评论