ProfileGroupSettings 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供对 group
配置文件节的 profiles
子节的编程访问。
public ref class ProfileGroupSettings sealed : System::Configuration::ConfigurationElement
public sealed class ProfileGroupSettings : System.Configuration.ConfigurationElement
type ProfileGroupSettings = class
inherit ConfigurationElement
Public NotInheritable Class ProfileGroupSettings
Inherits ConfigurationElement
- 继承
示例
下面的代码示例演示如何使用 ProfileGroupSettings 类型。 此代码示例是为 ProfileSection 类提供的一个更大示例的一部分。
// Add a new group.
ProfileGroupSettings newPropGroup = new ProfileGroupSettings("Forum");
profileSection.PropertySettings.GroupSettings.Add(newPropGroup);
// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);
// Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear();
' Add a new group.
Dim newPropGroup As ProfileGroupSettings = new ProfileGroupSettings("Forum")
profileSection.PropertySettings.GroupSettings.Add(newPropGroup)
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)
' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)
' Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear()
注解
类 ProfileGroupSettings 提供了一种以编程方式创建、访问和修改添加到 group
配置文件部分的子节 profile
的属性组的方法。
profile
配置文件的 节指定用户配置文件的架构。 在运行时,ASP.NET 编译系统使用 节中指定的 profile
信息生成一个名为 ProfileCommon
的类,该类派生自 ProfileBase。 类ProfileCommon
定义基于配置文件 部分的 子节profile
中properties
定义的属性。 为每个用户配置文件创建此类的实例,并且可以通过 属性访问代码 HttpContext.Profile 中的单个配置文件值。 有关添加到 ASP.NET 2.0 的配置文件功能的详细信息,请参阅 ASP.NET 配置文件属性概述。
构造函数
ProfileGroupSettings(String) |
使用默认设置初始化 ProfileGroupSettings 类的新实例。 |
属性
方法
适用于
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈