Пример #1
0
 private void IsUserExists()
 {
     string userName = Public.FilterSql(Request.Params["UserName"]);
     if (!string.IsNullOrEmpty(userName))
     {
         UserPage userPage = new UserPage();
         Response.Write(userPage.IsUserExists(userName));
         Response.End();
     }
     else
     {
         Response.Write("false");
         Response.End();
     }
 }
Пример #2
0
 private void Reg()
 {
     Model.User model = new Model.User();
     model.UpdateModel();
     UserPage userPage = new UserPage();
     if (userPage.IsUserExists(model.UserName))
     {
         MessageBox.ShowMessage("此账号已存在,请重新注册!", "reg.aspx");
     }
     else
     {
         model.UserPass = Encrypt.Md5(model.UserPass);
         model.CreateTime = DateTime.Now;
         model.Insert();
         MessageBox.ShowMessage("注册成功,请登录!", "login.aspx");
     }
 }