Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 Web 应用程序不像网站项目那样公开 ProfileCommon 类,因此哪些解决方案可用于访问配置文件信息。
虽然可能不是最佳选择(但就像您没有找到明显的其他选项一样 - 我也在使用自定义配置文件对象并没有帮助),但我使用了以下内容:
ProfileBase pb = ProfileBase.Create(Page.User.Identity.Name); m_PreferredName = pb.GetPropertyValue("WebName") as string;
可以在Create Method 文档中找到更多详细信息,包括将其转换为自定义类型的示例