登录窗口有:
       用户类型:ADMIN/USER
      用户名: ***
       密码:   ***    按扭:  确定   重填注册信息:ID USERTYPE USERNAME PWD PWDSURE USER_EMAIL用户数据库:库名:ssdb 用户表Users
       

解决方案 »

  1.   

    参考:
    http://www.cnblogs.com/luomingchao/articles/474674.html
      

  2.   

    asp.net中使用窗体身份验证
      

  3.   

    刚好在做项目 给你部分参考吧
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            
            haifei.BLL.HF_USER BLLHFUSER = new haifei.BLL.HF_USER();
            string PassMd5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.TxtPassword.Text,"MD5");
            bool Islogin = BLLHFUSER.Login(this.TxtUsername.Text, PassMd5);
            if (Islogin == true)
            {
                System.Web.Security.FormsAuthentication.RedirectFromLoginPage(this.TxtUsername.Text, true);
                HttpCookie lcookie = Context.Response.Cookies[FormsAuthentication.FormsCookieName];
                lcookie.Expires = DateTime.Now.AddYears(1);
            }
           
        }  <authentication mode="Forms">
              <forms loginUrl="Login.aspx"  defaultUrl="Vip/index.aspx" name="FUCK" >            <credentials passwordFormat="MD5">
                  
                </credentials>            </forms>
            </authentication>
    有些朋友在登陆的时候还对returnurl进行判断,空的情况跳转到默认的欢迎页,不为空的时候到进入的页面其实是多此一举,这样代码看上去很多,也很乱,你只要指定上面wenconfig的defaultUrl="Vip/index.aspx"就OK 了