ProfilePropertySettings 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
该 ProfilePropertySettings 类提供了一种以编程方式访问和修改 profiles 配置文件部分的方法。 此类不能被继承。
public ref class ProfilePropertySettings sealed : System::Configuration::ConfigurationElement
public sealed class ProfilePropertySettings : System.Configuration.ConfigurationElement
type ProfilePropertySettings = class
inherit ConfigurationElement
Public NotInheritable Class ProfilePropertySettings
Inherits ConfigurationElement
- 继承
示例
下面的代码示例演示如何访问 PropertySettings 包含对象集合的 ProfilePropertySettings 属性值。 该代码示例是 ProfileSection 类中的一个较大示例的一部分。
// Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:");
int rootPPSCtr = 0;
foreach (ProfilePropertySettings rootPPS in profileSection.PropertySettings)
{
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr,
rootPPS.Name);
}
' Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:")
Dim rootPPSCtr As Integer = 0
For Each rootPPS As ProfilePropertySettings In profileSection.PropertySettings
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr, _
rootPPS.Name)
Next
注解
该 ProfilePropertySettings 类提供了一种以编程方式创建、访问和修改添加到 properties 配置文件节子节 profile 的单个属性的定义的方法。
配置文件 profile 的节指定用户配置文件的架构。 在运行时,ASP.NET 编译系统使用节中指定的 profile 信息来生成一 ProfileCommon个名为(派生自 ProfileBase)的类。 类ProfileCommon定义基于配置文件节的子节properties中profile定义的属性。 为每个用户配置文件创建此类的实例,可以通过属性访问代码 HttpContext.Profile 中的单个配置文件值。 有关配置文件属性的详细信息,请参阅 ASP.NET 配置文件属性概述。 有关添加到 ASP.NET 2.0 的配置文件功能的详细信息,请参阅 ASP.NET 配置文件属性概述。
构造函数
| 名称 | 说明 |
|---|---|
| ProfilePropertySettings(String, Boolean, SerializationMode, String, String, String, Boolean, String) |
使用指定的名称和设置初始化类的新实例 ProfilePropertySettings 。 |
| ProfilePropertySettings(String) |
使用指定名称初始化类的新实例 ProfilePropertySettings 。 |