コード例 #1
0
 /// <summary>
 /// 根据Name和Password获取用户信息
 /// </summary>
 /// <param name="name"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static UserInfo GetUserInfo(string name, string password)
 {
     //加密密码
     password = new PwdToken(TokenConfig.PwdTokenKey, password).GetToken();
     return(DataProvider.Users.GetUserInfo(name, password));
 }
コード例 #2
0
 /// <summary>
 /// 检测密码是否正确
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static bool CheckPassword(int userId, string password)
 {
     //加密密码
     password = new PwdToken(TokenConfig.PwdTokenKey, password).GetToken();
     return(DataProvider.Users.GetCount(userId, password) > 0);
 }
コード例 #3
0
 /// <summary>
 /// 更新密码
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="newPassword"></param>
 /// <returns></returns>
 public static bool ModifyPassWord(int userId, string newPassword)
 {
     //加密密码
     newPassword = new PwdToken(TokenConfig.PwdTokenKey, newPassword).GetToken();
     return(DataProvider.Users.UpdatePassword(userId, newPassword) > 0);
 }
コード例 #4
0
 /// <summary>
 /// 更新用户密码
 /// </summary>
 /// <param name="email"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static bool ModifyPassWordByEmail(string email, string password)
 {
     //加密密码
     password = new PwdToken(TokenConfig.PwdTokenKey, password).GetToken();
     return(DataProvider.Users.UpdatePasswordByEmail(email, password) > 0);
 }
コード例 #5
0
 public void TestMethod1()
 {
     Token  tk  = new PwdToken(TokenConfig.PwdTokenKey, "000000");
     string pwd = tk.GetToken();
 }