imjyb1008work

login cs

May 14th, 2019
2,785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Security;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8.  
  9. namespace WebApplication1
  10. {
  11.     public partial class Login : System.Web.UI.Page
  12.     {
  13.         protected void Page_Load(object sender, EventArgs e)
  14.         {
  15.  
  16.         }
  17.  
  18.         protected void btnLogin_Click(object sender, EventArgs e)
  19.         {
  20.             if (txtAccount.Text == "admin" && txtPassword.Text == "1234")
  21.             {
  22.                 HttpCookie cookie = new HttpCookie(txtAccount.Text);
  23.                 Response.Cookies.Add(cookie);
  24.                 FormsAuthentication.RedirectFromLoginPage(txtAccount.Text, chkRememberMe.Checked);
  25.                
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment