Random rd = new Random();

            string data = rd.Next(111111111, 999999999).ToString();

            QRCodeGenerator q = new QRCodeGenerator();

            QRCodeGenerator.QRCode qc = q.CreateQrCode(data,

            QRCodeGenerator.ECCLevel.Q); 
            System.Drawing.Bitmap bm = qc.GetGraphic(28);
            MemoryStream ms = new MemoryStream();
            bm.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byte[] b = ms.ToArray();
            Image1.ImageUrl = "data:image/png;base64," +                                                                              `Convert.ToBase64String(b);`
            String qr = Image1.ImageUrl.ToString();

i have generated qr code and put into imagebox i need to save it to sql database in asp.net can any one help ! ?

Related posts

Recent Viewed