【问题标题】:What is the default class for managing ASP.NET profile properties管理 ASP.NET 配置文件属性的默认类是什么
【发布时间】:2019-10-20 19:15:48
【问题描述】:

在 .NET 中,我们有 System.Web.Security.Membership 类,它是创建、删除、搜索用户等的标准方法。它使用 web.config 文件中定义的基础成员资格提供程序。同样,我们有 System.Web.Security.Roles 类来管理分配给用户的角色。我在该命名空间中看不到用于管理配置文件属性的等效类。

管理配置文件属性的默认/类似类是什么? 我查看了System.Web.Profile.ProfileBase 类,但顾名思义,它应该用作基类,而不是直接调用。此类是否会自动使用 web.config 中引用的已定义配置文件提供程序?我不想要一个专门的课程,我可以称之为SetPropertyGetPropertySave

【问题讨论】:

    标签: asp.net asp.net-membership forms-authentication profile


    【解决方案1】:

    【讨论】:

    • 我正在寻找一个可以获取/设置特定用户配置文件的属性值的类。这似乎支持查找/删除配置文件对象,但不支持修改它们。
    • 为此,您需要派生自 ProfileBase 的类。您可以在 web.Config 中使用<profile inherits="..."> 将其连接起来,如下所述:weblogs.asp.net/jongalloway/…
    猜你喜欢
    • 2012-06-09
    • 2010-12-06
    • 1970-01-01
    • 2017-01-13
    • 1970-01-01
    • 2013-12-21
    • 1970-01-01
    • 2011-12-11
    • 2020-11-03
    相关资源
    最近更新 更多