如何获取自定义模块中的DNN User Profile字段和值?

How to Obtain DNN User Profile Fields and Values in Custom Module?

我正在开发一个自定义 DNN 模块,需要从用户那里收集敏感信息以用于支付网关入职流程。我们想要利用 DNN 用户配置文件模块并创建额外的必填字段。我找到了 DotnetNuke.Entities.Users.UserProfile 和 DotNetNuke.Security.Profile.ProfileProvder.GetUserProfile(UserInfo)。哪个命名空间是我们读取用户配置文件值的最佳选择?

您可以像这样阅读个人资料数据

using DotNetNuke.Entities.Profile;

ProfilePropertyDefinition ppd = UserInfo.Profile.GetProperty("FirstName");
string FirstName = ppd.PropertyValue;
using DotNetNuke.Entities.Profile;


 UserInfo oUserInfo = UserController.GetUserById(PortalSettings.PortalId, iUserID);
 string sCustomProperty = oUserInfo.Profile.GetPropertyValue("customproperty");