protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["trip"]) == "return")
        {
            btnreturnticket.Visible = true;
        }


        String bid  = Session["booking_id"].ToString();
        string code = "http://busbooking.somee.com/up.aspx?bid=" + bid;

        lblstring.Text = code;
        //string code = txtCode.Text;
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode          qrCode     = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 150;
        imgBarCode.Width  = 150;
        // plBarCode.Controls.Add(imgBarCode);
        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            plBarCode.Controls.Add(imgBarCode);
        }
    }
Exemple #2
0
    protected void btnGerar_Click(object sender, EventArgs e)
    {
        //Gerar o QRCode
        PHQRCode.Visible = true;

        string          valor       = txtValor.Text;
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(valor, QRCodeGenerator.ECCLevel.Q);


        System.Web.UI.WebControls.Image imgQRCode = new System.Web.UI.WebControls.Image();
        imgQRCode.Height = 250;
        imgQRCode.Width  = 250;

        using (Bitmap bitmap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgQRCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            PHQRCode.Controls.Add(imgQRCode);
        }
    }
Exemple #3
0
    /// <summary>
    /// Encode text in to a QR Code and define the colors and the Errer Correction Level
    /// </summary>
    /// <param name="text"></param>
    /// <param name="darkColor"></param>
    /// <param name="lightColor"></param>
    /// <param name="errorCorrectionLevel"></param>
    /// <returns></returns>
    public static Texture2D EncodeString(string text, Color darkColor, Color lightColor, QRCodeGenerator.ECCLevel errorCorrectionLevel)
    {
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(text, errorCorrectionLevel);

        Texture2D qrTexture = qrCode.GetGraphic(PIXELS_PER_MODULE, darkColor, lightColor);

        return(qrTexture);
    }
Exemple #4
0
    /// <summary>
    /// Encode text in to a QR Code
    /// </summary>
    /// <param name="text"></param>
    /// <returns></returns>
    public static Texture2D EncodeString(string text)
    {
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(text, QRCodeGenerator.ECCLevel.L);

        Texture2D qrTexture = qrCode.GetGraphic(PIXELS_PER_MODULE);

        return(qrTexture);
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Label11.Text = DateTime.Now.ToString("dd:MM:yyyy");
        SqlConnection con = new SqlConnection(strConnString);

        con.Open();
        str = "select * from register where Username='******'";
        com = new SqlCommand(str, con);
        SqlDataAdapter da  = new SqlDataAdapter(com);
        SqlDataReader  rdr = com.ExecuteReader();

        rdr.Read();
        Label14.Text = rdr["Name"].ToString();
        Label18.Text = rdr["ID"].ToString();
        rdr.Close();
        con.Close();
        con.Open();
        str = "select * from passdetail where Name='" + Label14.Text + "'";
        com = new SqlCommand(str, con);
        SqlDataAdapter san = new SqlDataAdapter(com);
        SqlDataReader  psr = com.ExecuteReader();

        psr.Read();
        Label3.Text  = psr["SOURCE"].ToString();
        Label5.Text  = psr["DESTINATION"].ToString();
        Label7.Text  = psr["VIA"].ToString();
        Label9.Text  = psr["FARE"].ToString();
        Label13.Text = psr["EXP"].ToString();
        Label16.Text = psr["CLASS"].ToString();
        psr.Close();
        con.Close();

        string          code        = Label18.Text;
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode          qrCode     = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 100;
        imgBarCode.Width  = 100;
        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            plBarCode.Controls.Add(imgBarCode);
        }
    }
Exemple #6
0
    // Create QR Code and save image in folder
    protected string UploadQRCode(String SkuName)
    {
        string          code        = SkuName;
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode          qrCode     = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 100;
        imgBarCode.Width  = 100;
        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            byte[] byteImage;
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byteImage           = ms.ToArray();
                imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            //plBarCode.Controls.Add(imgBarCode);

            //save QR code to images
            System.Drawing.Image image;
            using (MemoryStream ms = new MemoryStream(byteImage))
            {
                image = System.Drawing.Image.FromStream(ms);
            }
            //image.Save(Server.MapPath("~/Images/test.jpeg"));

            string actualfolder = string.Empty;
            actualfolder = HttpContext.Current.Server.MapPath("~/" + AppSettings.QRCODE_ROOTURL);
            DirectoryInfo actDir = new DirectoryInfo(actualfolder);
            //check if Directory exist if not create it
            if (!actDir.Exists)
            {
                Directory.CreateDirectory(actualfolder);
            }
            string filename      = string.Empty;
            string fullimagepath = string.Empty;
            fullimagepath = actualfolder + SkuName + ".jpg";
            //delete old files if Exists
            CommonFunctions.DeleteFile(fullimagepath);
            //save original image
            //txtImageName.PostedFile.SaveAs(fullimagepath);
            image.Save(fullimagepath);
        }
        return(Convert.ToString(SkuName + ".jpg"));
    }
    private void QrCodeGen(string Code)
    {
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(Code, QRCodeGenerator.ECCLevel.Q);

        System.Web.UI.WebControls.Image imgQRCode = new System.Web.UI.WebControls.Image();
        imgQRCode.Height = 150;
        imgQRCode.Width  = 150;

        using (Bitmap bitmap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgQRCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            PHQRCode.Controls.Add(imgQRCode);
        }
    }
Exemple #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string          code        = "http://localhost:49278/startpage.aspx";
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode          qrCode     = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 150;
        imgBarCode.Width  = 150;
        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            PlaceHolder1.Controls.Add(imgBarCode);
        }
        exportpdf();
    }
Exemple #9
0
    protected void btnGenerate_OnClick(object sender, EventArgs e)
    {
        string          Code        = txtCode.Text;
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(Code, QRCodeGenerator.ECCLevel.Q);

        Image imgQrCode = new Image();

        imgQrCode.Height = 150;
        imgQrCode.Width  = 150;

        using (Bitmap bitmap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgQrCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
            }
            PHQRCode.Controls.Add(imgQrCode);
        }
    }
    public void fillkko()
    {
        //Created By Anil Vishwakarma MailID([email protected])
        DataSet    ds = new DataSet();
        DataTable  dt = new DataTable();
        DataRow    dr;
        DataColumn pName;
        DataColumn pQty;
        DataColumn BName;
        DataColumn IID;
        DataColumn ilogo;

        pName = new DataColumn("QR_Code", Type.GetType("System.String"));
        pQty  = new DataColumn("Name", Type.GetType("System.String"));
        BName = new DataColumn("BName", Type.GetType("System.String"));
        IID   = new DataColumn("IID", Type.GetType("System.String"));
        ilogo = new DataColumn("ilogo", Type.GetType("System.String"));

        dt.Columns.Add(pName);
        dt.Columns.Add(pQty);
        dt.Columns.Add(BName);
        dt.Columns.Add(IID);
        dt.Columns.Add(ilogo);



        SqlConnection con = new SqlConnection(strconn);

        con.Open();

        SqlCommand cmd = new SqlCommand("SPName", con);

        cmd.CommandType = CommandType.StoredProcedure;

        cmd.Parameters.AddWithValue("@Type", "getRecvstockdata");
        cmd.Parameters.AddWithValue("@PurchaseID", PID);

        SqlDataAdapter da  = new SqlDataAdapter(cmd);
        DataTable      dts = new DataTable();

        da.Fill(dts);

        if (dts.Rows.Count > 0)
        {
            for (int i = 0; i < dts.Rows.Count; i++)
            {
                dr = dt.NewRow();
                //Created By Anil Vishwakarma MailID([email protected])
                string PurchaseId    = dts.Rows[i]["PurchaseID"].ToString();
                string itemname      = dts.Rows[i]["ItemName"].ToString();
                string batchno       = dts.Rows[i]["BatchNo"].ToString();
                string itemid        = dts.Rows[i]["Item_Id"].ToString();
                string Ponumber      = dts.Rows[i]["PurchaseId"].ToString();
                string quantity      = dts.Rows[i]["Quantity"].ToString();
                string hsncode       = dts.Rows[i]["HSN_Code"].ToString();
                string qty           = dts.Rows[i]["Item_Id"].ToString();
                string SrReferenceNo = dts.Rows[i]["SrReferenceNo"].ToString();
                string Parentrefno   = "";                                                                              // dts.Rows[i]["parentrefno"].ToString();
                string PName         = itemname + "\n" + batchno + "\n" + itemid;
                string code          = "";                                                                              //itemname //txtCode.Text;
                code = itemname + "," + itemid + "," + quantity + "," + batchno + "," + Ponumber + "," + SrReferenceNo; //+"," + Parentrefno;
                byte[]                          byteImage;
                QRCodeGenerator                 qrGenerator = new QRCodeGenerator();
                QRCodeGenerator.QRCode          qrCode      = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
                System.Web.UI.WebControls.Image imgBarCode  = new System.Web.UI.WebControls.Image();
                imgBarCode.Height = 140;
                imgBarCode.Width  = 140;
                string hjhjhj = "";
                using (Bitmap bitMap = qrCode.GetGraphic(20))
                {
                    string name = "";
                    using (MemoryStream ms = new MemoryStream())
                    {
                        bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        byteImage           = ms.ToArray();
                        imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                        name   = "Check";
                        hjhjhj = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                    }
                }
                //Created By Anil Vishwakarma MailID([email protected])
                string path = "Log/Ausadhawp.jpeg";
                dr["Name"]    = itemname;//.Replace("_", "_\n" + System.Environment.NewLine);//.Replace("_", "" + System.Environment.NewLine);
                dr["QR_COde"] = hjhjhj;
                dr["BName"]   = batchno;
                dr["IID"]     = itemid;
                dr["ilogo"]   = path;

                dt.Rows.Add(dr);
            }

            ds.Tables.Add(dt);
            Repeater1.DataSource = ds.Tables[0];
            Repeater1.DataBind();
            //Created By Anil Vishwakarma MailID([email protected])
        }
    }
Exemple #11
0
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Drawing; using System.IO; using System.Drawing.Imaging; using QRCoder; public partial class Login : System.Web.UI.Page { Criptografia cripto = new Criptografia("NEON"); String tipousu; protected void Page_Load(object sender, EventArgs e)
                                                                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                                                                        if (!IsPostBack)
                                                                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                                                                            Session["tipo"] = string.Empty;
                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                        QRCodeGenerator generator = new QRCodeGenerator(); Random r = new Random((int)DateTime.Now.Ticks); String numfinal = r.Next(1, 16).ToString() + r.Next(16, 32).ToString() + r.Next(32, 64).ToString() + r.Next(64, 128).ToString() + r.Next(128, 256).ToString(); QRCodeGenerator.QRCode qr = generator.CreateQrCode(numfinal, QRCodeGenerator.ECCLevel.Q); Bitmap img = qr.GetGraphic(16); MemoryStream memo = new MemoryStream(); img.Save(memo, ImageFormat.Png); byte[] b = memo.ToArray(); imgQRCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(b);
                                                                                                                                                                                                                                                                                                    }
Exemple #12
0
    protected void Button7_Click(object sender, EventArgs e)
    {
        string code = TextBox12.Text;

        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        QRCodeGenerator.QRCode          qrCode     = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
        imgBarCode.Height = 150;
        imgBarCode.Width  = 150;
        using (Bitmap bitMap = qrCode.GetGraphic(20))
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byteImage = ms.ToArray();
                imgBarCode.ImageUrl = "data:image/gif;base64," + Convert.ToBase64String(byteImage);
            }
            PlaceHolder1.Controls.Add(imgBarCode);

            using (Bitmap bitmap = qrCode.GetGraphic(20))
            {
                bitmap.Save(Server.MapPath("~/images/qrcode.png"), ImageFormat.Png);
            }
            Label32.Visible = true;


            SqlConnection Zcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionStringAPUASSIGNMENTSYS"].ConnectionString);
            Zcon.Open();
            string     Zinst = "INSERT INTO Assignment_Datas VALUES('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + Label21.Text + "','" + PlaceHolder1 + "')";
            SqlCommand Zcmd  = new SqlCommand(Zinst, Zcon);
            Zcmd.ExecuteNonQuery();

            Label33.Visible = true;
            Label33.Text    = "Your Assignment is submitted and an email notifcation along with QR code is send to you...Thanks";

            {
                SmtpClient smtp = new SmtpClient();
                smtp.Host        = "smtp.gmail.com";
                smtp.Port        = 587;
                smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "zxnmqwop1290");
                smtp.EnableSsl   = true;
                MailMessage msg = new MailMessage();
                msg.Subject = "Hello " + TextBox1.Text + "   We hope you are doing well";
                msg.Body    = "You have successfully submitted your assignment and a QR code is send to you for any kind of futher verfication or queries. And if you have submitted your assignment late then you will be asked to submit EC to the admin through this system.";
                FileStream fs = new FileStream(Server.MapPath("~/images/qrcode.png"),
                                               FileMode.Open, FileAccess.Read);
                Attachment a = new Attachment(fs, "~/images/qrcode.png", System.Net.Mime.MediaTypeNames.Application.Octet);
                msg.Attachments.Add(a);
                msg.IsBodyHtml = true;
                string toaddress = TextBox4.Text;
                msg.To.Add(toaddress);
                string fromaddress = "APU ASSIGNMENT SUBMISSION ANS ASSESSMENT SYSTEM <*****@*****.**>";
                msg.From = new MailAddress(fromaddress);
                try
                {
                    smtp.Send(msg);

                    TextBox1.Text      = "";
                    TextBox2.Text      = "";
                    TextBox3.Text      = "";
                    TextBox4.Text      = "";
                    TextBox5.Text      = "";
                    TextBox6.Text      = "";
                    TextBox7.Text      = "";
                    TextBox8.Text      = "";
                    TextBox9.Text      = "";
                    TextBox10.Text     = "";
                    TextBox11.Text     = "";
                    TextBox12.Text     = "";
                    lblmessage.Visible = false;
                }
                catch
                {
                    throw;
                }
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        con.Open();
        SqlDataAdapter da1 = new SqlDataAdapter("select * from registrations where username='******'", con);
        DataSet        ds1 = new DataSet();

        da1.Fill(ds1);
        con.Close();
        if (ds1.Tables[0].Rows.Count > 0)
        {
            counts = Convert.ToInt32(ds1.Tables[0].Rows[0]["count"]);
            string mobile = ds1.Tables[0].Rows[0]["mobile"].ToString();

            if (counts >= 3)
            {
                Response.Write("<script LANGUAGE=javascript>alert('You r Blocked')</script>");
                #region sms
                Random r   = new Random();
                int    otp = r.Next(1111, 9999);
                Session["username"] = TextBox1.Text;
                string msg = "Your are blocked pleease put your otp to unblocked";

                Session["otp"] = otp;
                string          strUrl     = "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=emailid:password&senderID=TEST SMS&receipientno=" + mobile + "&msgtxt=" + otp + "&state=4";
                WebRequest      request    = HttpWebRequest.Create(strUrl);
                HttpWebResponse response   = (HttpWebResponse)request.GetResponse();
                Stream          s          = (Stream)response.GetResponseStream();
                StreamReader    readStream = new StreamReader(s);
                string          dataString = readStream.ReadToEnd();
                response.Close();
                s.Close();
                readStream.Close();

                #endregion
                Response.Write("<script LANGUAGE='JavaScript' >alert('You r Blocked!')</script>");
                Response.Redirect("OTP.aspx");
            }
            else
            {
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter("select * from registrations where username='******'", con);
                DataSet        ds = new DataSet();
                da.Fill(ds);
                con.Close();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string pass   = ds.Tables[0].Rows[0]["password"].ToString();
                    int    count  = 36 - pass.Length;
                    string output = "";
                    for (int i = 0; i < count; i++)
                    {
                        output = output + "-";
                    }
                    string pswd = pass + output;


                    //--------Random Non-Repeating Arrays--------//
                    r     = pswd.OrderBy(z => random.Next()).Take(36).ToArray();
                    rchar = new string(r);

                    // var random = new Random();
                    //data = new string[x, y];

                    dt = null;
                    dt = new DataTable();
                    int k = 0;
                    for (int i = 0; i < x; i++)
                    {
                        dt.Columns.Add(i.ToString());
                    }
                    for (int i = 0; i < x; i++)
                    {
                        for (int j = 0; j < y; j++)
                        {
                            data[i, j] = rchar[k].ToString();

                            k++;
                        }



                        dt.Rows.Add(data[i, 0], data[i, 1], data[i, 2], data[i, 3], data[i, 4], data[i, 5]);
                    }
                    Session["data"] = data;
                    //GridView1.DataSource = dt;
                    //GridView1.DataBind();

                    //for (int l = 0; l < 6; l++)
                    //{
                    //    for (int z = 0; z < 6; z++)
                    //    {
                    //        var test = GridView1.Rows[l].Cells[z].Text = string.Empty;
                    //    }
                    //}
                    //--------Random Non-Repeating Arrays--------//
                    //--------Table--------//
                    for (int i = 0; i < x; i++)
                    {
                        var newRow = new TableRow();
                        for (int j = 0; j < y; j++)
                        {
                            var newCell = new TableCell();
                            newCell.Text = data[i, j];
                            newRow.Cells.Add(newCell);

                            if (i == 0)
                            {
                                if (j == 0)
                                {
                                    vl1 = data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    vl2 = vl1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    vl3 = vl2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    vl4 = vl3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    vl5 = vl4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    vl6 = vl5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                            if (i == 1)
                            {
                                if (j == 0)
                                {
                                    v1 = vl6 + System.Environment.NewLine + System.Environment.NewLine + data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    v2 = v1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    v3 = v2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    v4 = v3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    v5 = v4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    v6 = v5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                            if (i == 2)
                            {
                                if (j == 0)
                                {
                                    vq1 = v6 + System.Environment.NewLine + System.Environment.NewLine + data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    vq2 = vq1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    vq3 = vq2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    vq4 = vq3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    vq5 = vq4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    vq6 = vq5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                            if (i == 3)
                            {
                                if (j == 0)
                                {
                                    vt1 = vq6 + System.Environment.NewLine + System.Environment.NewLine + data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    vt2 = vt1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    vt3 = vt2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    vt4 = vt3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    vt5 = vt4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    vt6 = vt5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                            if (i == 4)
                            {
                                if (j == 0)
                                {
                                    vr1 = vt6 + System.Environment.NewLine + System.Environment.NewLine + data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    vr2 = vr1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    vr3 = vr2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    vr4 = vr3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    vr5 = vr4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    vr6 = vr5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                            if (i == 5)
                            {
                                if (j == 0)
                                {
                                    vw1 = vr6 + System.Environment.NewLine + System.Environment.NewLine + data[i, j].ToString();
                                }
                                if (j == 1)
                                {
                                    vw2 = vw1 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 2)
                                {
                                    vw3 = vw2 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 3)
                                {
                                    vw4 = vw3 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 4)
                                {
                                    vw5 = vw4 + " " + "\t" + data[i, j].ToString();
                                }
                                if (j == 5)
                                {
                                    vw6 = vw5 + " " + "\t" + data[i, j].ToString();
                                }
                            }
                        }
                        Table1.Rows.Add(newRow);
                    }
                    string p = String.Concat(r);
                    con.Open();
                    SqlCommand cmd = new SqlCommand("insert into tpass values('" + p + "')", con);
                    cmd.ExecuteNonQuery();
                    con.Close();


                    //--------Table--------//
                    //r = schar.OrderBy(z => random.Next()).Take(36).ToArray();

                    // string code = txtCode.Text;


                    QRCodeGenerator                 qrGenerator = new QRCodeGenerator();
                    QRCodeGenerator.QRCode          qrCode      = qrGenerator.CreateQrCode(vw6, QRCodeGenerator.ECCLevel.Q);
                    System.Web.UI.WebControls.Image imgBarCode  = new System.Web.UI.WebControls.Image();
                    imgBarCode.Height = 150;
                    imgBarCode.Width  = 150;
                    using (Bitmap bitMap = qrCode.GetGraphic(20))
                    {
                        using (MemoryStream ms = new MemoryStream())
                        {
                            bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                            byte[] byteImage = ms.ToArray();
                            imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                        }
                        PlaceHolder1.Controls.Add(imgBarCode);
                    }
                }


                else
                {
                    Response.Write("<script LANGUAGE='JavaScript' >alert('Invalid Username')</script>");
                }
            }
        }
    }