如何使用asp.net创建QR码编码和解码? [英] How to create QR Code encode and decode using asp.net ?

查看:116
本文介绍了如何使用asp.net创建QR码编码和解码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用asp.net创建QR码编码和解码?

How to create QR Code encode and decode using asp.net ?

推荐答案

参考此链接



开源QRCode库 [ ^ ]



另一个可以实现的简单代码:



1)从此链接下载Messaging Toolkit DLL:



MessagingToolkit.QRCode.dll [ ^ ]



2)将其引用包含在您的程序中并按如下方式进行:



Refer to this link

Open Source QRCode Library[^]

Another simple code that you can implement:

1) Download Messaging Toolkit DLL from this link:

MessagingToolkit.QRCode.dll [^]

2)Include its reference into your program and proceed as follows:

using MessagingToolkit.QRCode.Codec;
using MessagingToolkit.QRCode.Codec.Data;
using System.IO;





编码:





Encoding:

string yourcode= textBox1.Text;
QRCodeEncoder enc = new QRCodeEncoder();
Bitmap qrcode = enc.Encode(yourcode);
pictureBox1.Image = qrcode as Image;//Displays generated code in PictureBox





解码:



Decoding:

QRCodeDecoder dec = new QRCodeDecoder();
textBox2.Text = (dec.decode(new QRCodeBitmapImage(pictureBox1.Image as Bitmap)));







问候......:笑:




Regards.. :laugh:


尝试使用google zxing .net端口 http://zxingnet.codeplex.com/ [ ^ ]
Try google zxing .net port available here http://zxingnet.codeplex.com/[^]


这篇关于如何使用asp.net创建QR码编码和解码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆