CMS, 原创, , , , ,

DNN(DotNetNuke) User Integrate,Password Authentication,Get User InformationDNN(DotNetNuke) 用户登录整合,密码验证方式,用户资料获取 的方法

DotNetNuke  get current user infomation

using DotNetNuke.Entities.Users;
var userInfo = UserController.GetCurrentUserInfo();

DNN (DotNetNuke)  get user info ( width username) which has less infomation

MembershipUser user = Membership.GetUser();
//username is user.UserName;
//If you know the username you can also use
MembershipUser user = Membership.GetUser(username);

DNN get user information through the user name

var userInfo = UserController.GetUserByName(username);
//Email: userInfo.Email
//NickName: userInfo.DisplayName
//Avatar: string.Format(Globals.UserProfilePicFormattedUrl(), userInfo.UserID, 128, 128))

Validate user name and password

if(Membership.ValidateUser(username, password)){
  //validate pass
}

DotNetNuke 获取当前登录用户资料

using DotNetNuke.Entities.Users;
var userInfo = UserController.GetCurrentUserInfo();

DNN (DotNetNuke) 获取用户信息代码(这个获取到的内容少些)

MembershipUser user = Membership.GetUser();
//用户名就是 user.UserName;
//如果知道了用户名也可以使用
MembershipUser user = Membership.GetUser(username);

DNN通过用户名获取用户资料

var userInfo = UserController.GetUserByName(username);
//Email: userInfo.Email
//NickName: userInfo.DisplayName
//Avatar: string.Format(Globals.UserProfilePicFormattedUrl(), userInfo.UserID, 128, 128))

验证用户名和密码是否正确

if(Membership.ValidateUser(username, password)){
  //验证通过
}

(11265)

Related Post