I have created a QR code. I want to open my site after scanning the QR code, but it always only shows text. How can I open a website using a browser after scanning my QR code in C#?
Here is my qrcode.aspx.cs:
using MessagingToolkit.QRCode.Codec;
using System.Drawing;
using System.Drawing.Imaging;
namespace WebApplication3
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string url= "http://mysite/login.aspx";
QRCodeEncoder encoder = new QRCodeEncoder();
encoder.QRCodeScale = 10;
System.Drawing.Image logo = System.Drawing.Image.FromFile(Server.MapPath("/img/logo.gif"));
Bitmap img = encoder.Encode(url);
Graphics g = Graphics.FromImage(img);
int left = (img.Width - logo.Width) / 2;
int top = (img.Height - logo.Height) / 2;
g.DrawImage(logo, new Point(left, top));
img.Save(Server.MapPath("/qrcode/" + url+ ".jpg"), ImageFormat.Jpeg);
Image1.ImageUrl = "/qrcode/" + url+ ".jpg";
}
}
}
question from:
https://stackoverflow.com/questions/65862023/how-to-open-a-url-using-browser-after-scanning-qr-code-in-c 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…