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
定义基于配置文件的子节profile
中properties
定义的属性。 为每个用户配置文件创建此类实例,可以通过属性访问代码 HttpContext.Profile 中的单个配置文件值。 有关配置文件属性的详细信息,请参阅 ASP.NET 配置文件属性概述。 有关添加到 ASP.NET 2.0 的配置文件功能的详细信息,请参阅 ASP.NET 配置文件属性概述。