[WebMethod]//会员注册 public string register(string account, string pwd, string email) { userinfo item = new userinfo(); item.accounts = HttpUtility.UrlDecode(account); item.pwd = Des.MD5(HttpUtility.UrlDecode(pwd)); item.email = HttpUtility.UrlDecode(email); item.adddate = DateTime.Now; item.atid = 1; Random r = new Random(); int num = r.Next(1, 72); item.headerimg = num.ToString() + ".jpg"; bool result = user.adduser(item); if (result) { string uid = user.getuidbyemail(item); HttpCookie uidcookie = new HttpCookie("tfuid"); uidcookie.Value = uid.ToString(); HttpContext.Current.Response.Cookies.Add(uidcookie); return("t"); } else { return("f"); } }
[WebMethod]//检查修改的密码 public string checkeditpwd(string pwd, string userid) { userinfo item = new userinfo(); item.pwd = Des.MD5(pwd); item.userid = userid; bool result = user.checkpwd(item); if (result) { return("t"); } else { return("f"); } }
[WebMethod]//email登录 public string emaillogin(string pwd, string email) { userinfo item = new userinfo(); item.pwd = Des.MD5(HttpUtility.UrlDecode(pwd)); item.email = HttpUtility.UrlDecode(email); bool result = user.emaillogin(item); if (result) { string uid = user.getuidbyemail(item); return(uid); } else { return("f"); } }
[WebMethod]//账号登录 public string userlogin(string pwd, string accounts) { userinfo item = new userinfo(); item.pwd = Des.MD5(HttpUtility.UrlDecode(pwd)); item.accounts = HttpUtility.UrlDecode(accounts); bool result = user.usernamelogin(item); if (result) { string uid = user.getuseridbyusername(item); return(uid); } else { return("f"); } }