dnn|dotnetnuke 获取用户信息

Private Sub getUserInfo()
        'Add reference to DotNetNuke.dll
        Dim mRoles As New DotNetNuke.Entities.Users.OnlineUserInfo
        Dim mUserRoles As New DotNetNuke.Security.Roles.RoleController
        Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo

        Dim showRoles As String = ""

        For Each i As String In mUserRoles.GetRolesByUser(mUser.UserID, mRoles.PortalID)
            showRoles += i.ToString() + ", "
        Next

        'Me.Label1.Text = "UserName: " + mUser.Username
        'Me.Label1.Text += "<br /> Full Name: " + mUser.FullName
        'Me.Label1.Text += "<br /> UserID: " + mRoles.UserID.ToString()
        'Me.Label1.Text += "<br /> Roles: " + showRoles
    End Sub

你可能感兴趣的:(dnn|dotnetnuke 获取用户信息)