Click here to Skip to main content
15,909,193 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
How to create QR Code encode and decode using asp.net ?
Posted
Updated 28-May-18 7:06am
Comments
[no name] 16-Jun-13 13:57pm    
You start by following rule #1 here, http://www.codeproject.com/Articles/64628/Code-Project-Quick-Answers-FAQ#rules

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:

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


Encoding:

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


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



Regards.. :laugh:
 
Share this answer
 
v2
Comments
manojmadhuranga 7-Mar-14 23:32pm    
Great man...This Codes really Worked for me...
Thanks7872 8-Mar-14 9:16am    
Glad to know that this helped you. Cheers..!
manojmadhuranga 10-Mar-14 6:40am    
can't we attach a list to the QR Code..?
Member 11302371 19-Dec-15 5:46am    
.dll file not generate in toolbox.....
Member 12232091 1-Feb-16 2:19am    
is there another alternative for picturebox as i doing a project required qrcode for asp.net?
Try google zxing .net port available here http://zxingnet.codeplex.com/[^]
 
Share this answer
 
Comments
Member 11063220 20-Sep-14 17:38pm    
Hi,

I have tried the dll and think it is quite well.
Only problem: I found there are two thin white lines, one at the right edge and another at the bottom edge of the encoded image.
I need to know if this is a bug, or any thing I can do?

Thanks a lot for your help!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900