public static AccountsPrincipal ValidateLogin(string userName, string password) { byte[] encPassword = EncryptPassword(password); Data.User user = new Data.User(PubConstant.ConnectionString); int userID = user.ValidateLogin(userName, encPassword); if (userID > 0) { return(new AccountsPrincipal(userID)); } return(null); }
/// <summary> /// 验证登录信息 /// </summary> public static AccountsPrincipal ValidateLogin(string userName, string password) { int newID; byte[] cryptPassword = EncryptPassword(password); Data.User dataUser = new Data.User(); if ((newID = dataUser.ValidateLogin(userName, cryptPassword)) > 0) { return(new AccountsPrincipal(newID)); } else { return(null); } }
/// <summary> /// 验证登录信息 /// </summary> public static AccountsPrincipal ValidateLogin(string userName, string password) { int newID; byte[] cryptPassword = EncryptPassword( password ); Data.User dataUser = new Data.User(); if ((newID = dataUser.ValidateLogin(userName, cryptPassword)) > 0 ) return new AccountsPrincipal( newID ); else return null; }