• 手写登录


    namespace X
    {
         public class Login:System.Web.UI.Page
    {
        protected string PreUserName={get;set;}
    protected string Js={get;set;}
    protected void Load_Page(object sender,EventAges e)
    {
        if(!IsPostBack)
    {
        PreUserName=Request.Cookies["txtusername"]==null?string.Empty:Request.Cookies["txtusername"].value;
     
    }
    else
    {
        PreUserName=Request["txtLoginName"];
    }
     
    }
    protected void btnLoginClick(object sender,ImageButtonEventAges e)
    {
        string sendCode=Session["ValidateCode"]==null?String.Empty:Session["ValidateCode"].ToString();
        string reviceCode=Request["txtCode"];
    if(!sendCode.Equals(reviceCode))
    {
       Js="<script>alert('验证码不正确')</script>";
    return ;
    }
    string struserName=Request["txtLoginName"];
    string strPwd=Request["txtPwd"];
    BLL.CZBK_user Infouserservice=new CZBK_user();
    Model.CZBK_user user=Infouserservice.getModelList(userName,Password);
        if(user==null)
    {
        Js="<script>alert('用户名和密码不正确')</script>";
    return;
    }
    Session["txtLoginName"]=user;
    string name=Request["txtLogin"];
    if(!string.IsNullOrEmpty(name))
    {
        Response.Cookies["struserName"]=name;
    Response.Cookies["struserName"].Expirse=DateTime.Now.AddDays(7);
    }
    Response.Redirct("AdminIndex.aspx");
    }
    }
    }
  • 相关阅读:
    animate动画回调函数
    triggerHandler不执行事件默认值
    trigger自动执行事件
    js与jquery对象的互转
    让低版本浏览器支持html5的标签
    闭包的好处罗列
    AJAX跨域
    php能干什么?
    concat() 方法用于连接两个或多个数组。
    使用 v-cloak 防止页面加载时出现 vuejs 的变量名
  • 原文地址:https://www.cnblogs.com/nieyulin123/p/3068236.html
Copyright © 2020-2023  润新知