有谁知道在ASP.net程序中实现登录注册功能

解决方案 »

  1.   

    额.....2个textbox.一个button,点击button的时候在后台select数据库,.....
    这个是一个高深的问题.lz慢慢研究.10年八载就应该略懂皮毛的了
      

  2.   

    用ASP.NET自带的用户/角色系统,
    从数据库建立到后台代码,都给你包办了.你也就是拖几个控件.
      

  3.   

             两个textbox  两个button    加一个容器   ok      
     
             难度很大啊、LZ 还是慢点研究吧........         
      

  4.   

    一个用户名框,一个密码框,一个登录按扭,Click 登录了
      

  5.   

    给个登录的你吧。注册的,,,太。。if (!HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    string strName = Request.Form["username"];
                    string strPwd = Request.Form["password"];
                    //验证
                    string sd = FormsAuthentication.HashPasswordForStoringInConfigFile(strPwd.Trim(), "MD5").ToString().ToLower().Substring(8, 16);
                    System.Data.DataSet ds = new BLL.web_user().GetList(" username='" + strName + "' and userpwd='" + sd + "'");
                    bool f = false;//是否保存登录状态
                    if (this.sty.Checked)
                    {
                        f = true;
                    }
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        //验证成功
                        string strURL = System.Web.Security.FormsAuthentication.GetRedirectUrl(System.Web.Security.FormsAuthentication.FormsCookieName, true);//这个是用户请求的页面路径
                        System.Web.Security.FormsAuthentication.SetAuthCookie(ds.Tables[0].Rows[0]["username"].ToString(), f);//给用户颁发Cookie凭证
                        if (strURL == null)
                        {
                            //用户原请求页面为空时
                            Response.Redirect("/default.aspx");
                        }
                        else
                        {
                            Response.Redirect(strURL);//用户原请求页面不为空时,转到请求页面
                        }
                    }
                    else
                    {
                        this.sty.Checked = false;
                        Common.MessageBox.Show(Page, "用户名密码不一致!");
                    }
                }
                else
                {
                    Common.MessageBox.ShowAndRedirect(this.Page, "请不要重复登录!","/default.aspx");
                }
      

  6.   


    textbox前面加两个 lable 也可以啊