Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.Data.OleDb;
- public partial class Login : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Request.Form["send"] != null)
- {
- string us = Request.Form["user_name"];
- string pass = Request.Form["password"];
- OleDbConnection conn = new OleDbConnection(Connect.getConnectionString());
- conn.Open();
- string sq1 = "select username from tblUsers where username = '" + us + "' and pass = '" + pass + "'";
- OleDbCommand comm = new OleDbCommand(sq1, conn);
- string us2 = (string)comm.ExecuteScalar();
- if (us2 == null)
- Response.Redirect("Register.aspx");
- else
- {
- Session["username"] = us;
- Session["pass"] = pass;
- Response.Redirect("Default.aspx");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment