ProfileSection 类

定义

ProfileSection 类提供一种以编程方式访问和修改配置文件的 profile 节的方法。The ProfileSection class provides a way to programmatically access and modify the profile section of a configuration file. 此类不能被继承。This class cannot be inherited.

public ref class ProfileSection sealed : System::Configuration::ConfigurationSection
public sealed class ProfileSection : System.Configuration.ConfigurationSection
type ProfileSection = class
    inherit ConfigurationSection
Public NotInheritable Class ProfileSection
Inherits ConfigurationSection
继承

示例

下面的配置文件节选显示了如何以声明方式为ProfileSection类的几个属性指定值。The following configuration file excerpt shows how to declaratively specify values for several properties of the ProfileSection class.

<system.web>  
  <profile enabled = "true"   
     defaultProvider="AspNetSqlProfileProvider">  
    <providers>  
      <add  name="AspNetSqlProfileProvider"  
        type="System.Web.Profile.SqlProfileProvider"  
        connectionStringName="LocalSqlServer"  
        applicationName="/"  
        description="Stores and retrieves profile data from the   
local Microsoft SQL Server database" />  
    </providers>  
    <properties>  
      <add name = "FirstName"/>  
      <add name = "LastName"/>  
      <add name = "FavoriteURLs" type =  
        "System.Collection.Specialized.StringCollection, System"   
        serializeAs = "Xml"/>        
      <add name = "ShoppingCart" type =   
        "MyCommerce.ShoppingCart, MyCommerce"   
        serializeAs = "Binary"/>  
      <group name = "SiteColors" >  
        <add name = "BackGround"/>  
        <add name = "SideBar"/>  
        <add name = "ForeGroundText"/>  
        <add name = "ForeGroundBorders"/>  
      </group>  
      <group name="Forums">  
        <add name = "HasAvatar" type="bool" provider="Forums"/>  
        <add name = "LastLogin" type="DateTime" provider="Forums"/>  
        <add name = "TotalPosts" type="int" provider="Forums"/>  
      </group>  
    </properties>  
  </profile>  
</system.web>  

下面的代码示例演示如何使用ProfileSection类型。The following code example shows how to use the ProfileSection type.

using System;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Configuration;
using System.Web.Configuration;

namespace Samples.Aspnet.SystemWebConfiguration
{
    // Accesses the System.Web.Configuration.ProfileSection members
    // selected by the user.
    class UsingProfileSection
    {
        public static void Main()
        {
            // Process the System.Web.Configuration.ProfileSectionobject.
            try
            {
                // Get the Web application configuration.
                System.Configuration.Configuration configuration = 
                    System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnet");
                
                // Get the section.
                System.Web.Configuration.ProfileSection profileSection = 
                    (System.Web.Configuration.ProfileSection) 
                    configuration.GetSection("system.web/profile");

// Get the current AutomaticSaveEnabled property value.
Console.WriteLine(
    "Current AutomaticSaveEnabled value: '{0}'", profileSection.AutomaticSaveEnabled);

// Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false;

                

// Get the current DefaultProvider property value.
Console.WriteLine(
    "Current DefaultProvider value: '{0}'", profileSection.DefaultProvider);

// Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider";

                

// Get the current Inherits property value.
Console.WriteLine(
    "Current Inherits value: '{0}'", profileSection.Inherits);

// Set the Inherits property to
// "CustomProfiles.MyCustomProfile, CustomProfiles.dll".
profileSection.Inherits = "CustomProfiles.MyCustomProfile, CustomProfiles.dll";

                

// 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);
}

// Get and modify a root ProfilePropertySettings object.
Console.WriteLine(
    "Display and modify 'LastReadDate' ProfilePropertySettings:");
ProfilePropertySettings profilePropertySettings =
    profileSection.PropertySettings["LastReadDate"];

// Get the current ReadOnly property value.
Console.WriteLine(
    "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly);

// Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true;

// Get the current AllowAnonymous property value.
Console.WriteLine(
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous);

// Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true;

// Get the current SerializeAs property value.
Console.WriteLine(
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs);

// Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary;

// Get the current Type property value.
Console.WriteLine(
    "Current Type value: '{0}'", profilePropertySettings.Type);

// Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime";

// Get the current DefaultValue property value.
Console.WriteLine(
    "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue);

// Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004";

// Get the current ProviderName property value.
Console.WriteLine(
    "Current ProviderName value: '{0}'", profilePropertySettings.Provider);

// Set the ProviderName property to "AspNetSqlRoleProvider".
profilePropertySettings.Provider = "AspNetSqlRoleProvider";

// Get the current Name property value.
Console.WriteLine(
    "Current Name value: '{0}'", profilePropertySettings.Name);

// Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate";

// Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:");
int PGSCtr = 0;
foreach (ProfileGroupSettings propGroups in profileSection.PropertySettings.GroupSettings)
{
    Console.WriteLine("  {0}: ProfileGroupSetting '{1}'", ++PGSCtr,
        propGroups.Name);
    int PPSCtr = 0;
    foreach (ProfilePropertySettings props in propGroups.PropertySettings)
    {
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr,
            props.Name);
    }
}

// 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();

                

// Display all current Providers.
Console.WriteLine("Current Providers:");
int providerCtr = 0;
foreach (ProviderSettings provider in profileSection.Providers)
{
    Console.WriteLine("  {0}: Provider '{1}' of type '{2}'", ++providerCtr, 
        provider.Name, provider.Type);
}

// Add a new provider.
profileSection.Providers.Add(new ProviderSettings("AspNetSqlProvider", "...SqlProfileProvider"));

                

// Get the current Enabled property value.
Console.WriteLine(
    "Current Enabled value: '{0}'", profileSection.Enabled);

// Set the Enabled property to false.
profileSection.Enabled = false;

                
                // Update if not locked.
                if (! profileSection.SectionInformation.IsLocked)
                {
                    configuration.Save();
                    Console.WriteLine("** Configuration updated.");
                }
                else
                    Console.WriteLine("** Could not update, section is locked.");
            }
            catch (System.ArgumentException e)
            {
                // Unknown error.
                Console.WriteLine(
                    "A invalid argument exception detected in UsingProfileSection Main. Check your");
                Console.WriteLine("command line for errors.");
            }
        }
    } // UsingProfileSection class end.
    
} // Samples.Aspnet.SystemWebConfiguration namespace end.

Imports System.Collections
Imports System.Collections.Specialized
Imports System.IO
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Configuration
Imports System.Web.Configuration

Namespace Samples.Aspnet.SystemWebConfiguration
    ' Accesses the System.Web.Configuration.ProfileSection members
    ' selected by the user.
    Class UsingProfileSection
        Public Shared Sub Main()
            ' Process the System.Web.Configuration.ProfileSectionobject.
            Try
                ' Get the Web application configuration.
                Dim configuration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnet")
                
                ' Get the section.
                Dim profileSection As System.Web.Configuration.ProfileSection = CType(configuration.GetSection("system.web/profile"), System.Web.Configuration.ProfileSection)

' Get the current AutomaticSaveEnabled property value.
Console.WriteLine( _
    "Current AutomaticSaveEnabled value: '{0}'", profileSection.AutomaticSaveEnabled)

' Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false

                

' Get the current DefaultProvider property value.
Console.WriteLine( _
    "Current DefaultProvider value: '{0}'", profileSection.DefaultProvider)

' Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider"

                

' Get the current Inherits property value.
Console.WriteLine( _
    "Current Inherits value: '{0}'", profileSection.Inherits)

' Set the Inherits property to
' "CustomProfiles.MyCustomProfile, CustomProfiles.dll".
profileSection.Inherits = "CustomProfiles.MyCustomProfile, CustomProfiles.dll"

                


' 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

' Get and modify a root ProfilePropertySettings object.
Console.WriteLine( _
    "Display and modify 'LastReadDate' ProfilePropertySettings:")
Dim profilePropertySettings As ProfilePropertySettings = _
    profileSection.PropertySettings("LastReadDate")

' Get the current ReadOnly property value.
Console.WriteLine( _
    "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly)

' Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true

' Get the current AllowAnonymous property value.
Console.WriteLine( _
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous)

' Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true

' Get the current SerializeAs property value.
Console.WriteLine( _
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs)

' Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary

' Get the current Type property value.
Console.WriteLine( _
    "Current Type value: '{0}'", profilePropertySettings.Type)

' Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime"

' Get the current DefaultValue property value.
Console.WriteLine( _
    "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue)

' Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004"

' Get the current ProviderName property value.
            Console.WriteLine( _
                "Current ProviderName value: '{0}'", profilePropertySettings.Provider)

' Set the ProviderName property to "AspNetSqlRoleProvider".
            profilePropertySettings.Provider = "AspNetSqlRoleProvider"

' Get the current Name property value.
Console.WriteLine( _
    "Current Name value: '{0}'", profilePropertySettings.Name)

' Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate"

' Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:")
Dim PGSCtr As Integer = 0
For Each propGroups As ProfileGroupSettings In profileSection.PropertySettings.GroupSettings
                    Console.WriteLine("  {0}: ProfileGroupSettings '{1}'", ++PGSCtr, _
        propGroups.Name)
    Dim PPSCtr As Integer = 0
    For Each props As ProfilePropertySettings In propGroups.PropertySettings
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr, _
            props.Name)
    Next
Next

' 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()

                

Console.WriteLine("Current Providers:")
Dim providerCtr As Integer = 0
For Each provider As ProviderSettings In profileSection.Providers
    Console.WriteLine("  {0}: Provider '{1}' of type '{2}'", ++providerCtr, _
        provider.Name, provider.Type)
Next

' Add a new provider.
profileSection.Providers.Add(new ProviderSettings("AspNetSqlProvider", "...SqlProfileProvider"))

                

' Get the current Enabled property value.
Console.WriteLine( _
    "Current Enabled value: '{0}'", profileSection.Enabled)

' Set the Enabled property to false.
profileSection.Enabled = false

                
                ' Update if not locked.
                If Not profileSection.SectionInformation.IsLocked Then
                    configuration.Save()
                    Console.WriteLine("** Configuration updated.")
                Else
                    Console.WriteLine("** Could not update, section is locked.")
                End If
            Catch e As System.ArgumentException
                ' Unknown error.
                Console.WriteLine( _
                    "A invalid argument exception detected in UsingProfileSection Main. Check your")
                Console.WriteLine("command line for errors.")
            End Try
        End Sub
    End Class
    
End Namespace ' Samples.Aspnet.SystemWebConfiguration

注解

类提供一种以编程方式访问和修改配置文件profile的内容的方法。 ProfileSectionThe ProfileSection class provides a way to programmatically access and modify the content of the configuration file profile section. 配置profile文件的部分指定用户配置文件的架构。The profile section of the configuration file specifies a schema for user profiles. 在运行时, ASP.NET 编译系统使用profile部分中指定的信息来生成一个名ProfileCommon为的类, 该类派生自ProfileBaseAt run time, the ASP.NET compilation system uses the information specified in the profile section to generate a class called ProfileCommon, which is derived from ProfileBase. 类定义基于配置文件的profile部分中定义的属性。 ProfileCommonThe ProfileCommon class definition is based on the properties defined in the profile section of the configuration file. 类允许访问和修改各个配置文件的值。The class allows you to access and modify the values for individual profiles. 此类的实例是为每个用户配置文件创建的, 你可以通过HttpContext.Profile属性访问代码中的各个配置文件值。An instance of this class is created for each user profile, and you can access the individual profile values in your code through the HttpContext.Profile property. 有关添加到ASP.NET 2.0ASP.NET 2.0的配置文件功能的详细信息, 请参阅ASP.NET profile Properties 概述For more information about the profile features added to ASP.NET 2.0ASP.NET 2.0, see ASP.NET Profile Properties Overview.

构造函数

ProfileSection()

使用默认设置初始化 ProfileSection 类的新实例。Initializes a new instance of the ProfileSection class using default settings.

属性

AutomaticSaveEnabled

获取或设置一个值,该值确定页退出时是否自动保存对用户配置文件信息的更改。Gets or sets a value that determines whether changes to user-profile information are automatically saved on page exit.

CurrentConfiguration

获取对顶级 Configuration 实例的引用,该实例表示当前 ConfigurationElement 实例所属的配置层次结构。Gets a reference to the top-level Configuration instance that represents the configuration hierarchy that the current ConfigurationElement instance belongs to.

(继承自 ConfigurationElement)
DefaultProvider

获取或设置默认配置文件提供程序的名称。Gets or sets the name of the default profile provider.

ElementInformation

获取包含 ConfigurationElement 对象的不可自定义的信息和功能的 ElementInformation 对象。Gets an ElementInformation object that contains the non-customizable information and functionality of the ConfigurationElement object.

(继承自 ConfigurationElement)
ElementProperty

获取表示 ConfigurationElement 对象本身的 ConfigurationElementProperty 对象。Gets the ConfigurationElementProperty object that represents the ConfigurationElement object itself.

(继承自 ConfigurationElement)
Enabled

获取或设置一个值,该值指示是否启用 ASP.NET 配置文件功能。Gets or sets a value indicating whether the ASP.NET profile feature is enabled.

EvaluationContext

获取 ConfigurationElement 对象的 ContextInformation 对象。Gets the ContextInformation object for the ConfigurationElement object.

(继承自 ConfigurationElement)
HasContext

获取一个值,该值指示 CurrentConfiguration 属性是否为 nullGets a value that indicates whether the CurrentConfiguration property is null.

(继承自 ConfigurationElement)
Inherits

获取或设置派生自 ProfileBase 的自定义类型的类型引用。Gets or sets a type reference for a custom type derived from ProfileBase.

Item[ConfigurationProperty]

获取或设置此配置元素的属性或特性。Gets or sets a property or attribute of this configuration element.

(继承自 ConfigurationElement)
Item[String]

获取或设置此配置元素的属性、特性或子元素。Gets or sets a property, attribute, or child element of this configuration element.

(继承自 ConfigurationElement)
LockAllAttributesExcept

获取被锁定的特性的集合。Gets the collection of locked attributes.

(继承自 ConfigurationElement)
LockAllElementsExcept

获取被锁定的元素的集合。Gets the collection of locked elements.

(继承自 ConfigurationElement)
LockAttributes

获取被锁定的特性的集合。Gets the collection of locked attributes.

(继承自 ConfigurationElement)
LockElements

获取被锁定的元素的集合。Gets the collection of locked elements.

(继承自 ConfigurationElement)
LockItem

获取或设置一个值,该值指示是否已锁定该元素。Gets or sets a value indicating whether the element is locked.

(继承自 ConfigurationElement)
Properties

获取属性的集合。Gets the collection of properties.

(继承自 ConfigurationElement)
PropertySettings

获取 ProfilePropertySettings 对象的 RootProfilePropertySettingsCollection 集合。Gets a RootProfilePropertySettingsCollection collection of ProfilePropertySettings objects.

Providers

获取 ProviderSettings 对象的集合。Gets a collection of ProviderSettings objects.

SectionInformation

获取一个 SectionInformation 对象,该对象包含 ConfigurationSection 对象的不可自定义的信息和功能。Gets a SectionInformation object that contains the non-customizable information and functionality of the ConfigurationSection object.

(继承自 ConfigurationSection)

方法

DeserializeElement(XmlReader, Boolean)

从配置文件读取 XML。Reads XML from the configuration file.

(继承自 ConfigurationElement)
DeserializeSection(XmlReader)

从配置文件读取 XML。Reads XML from the configuration file.

(继承自 ConfigurationSection)
Equals(Object)

将当前的 ConfigurationElement 实例与指定的对象进行比较。Compares the current ConfigurationElement instance to the specified object.

(继承自 ConfigurationElement)
GetHashCode()

获取表示当前 ConfigurationElement 实例的唯一值。Gets a unique value representing the current ConfigurationElement instance.

(继承自 ConfigurationElement)
GetRuntimeObject()

在派生的类中重写时返回自定义对象。Returns a custom object when overridden in a derived class.

(继承自 ConfigurationSection)
GetTransformedAssemblyString(String)

返回指定程序集名称的转换版本。Returns the transformed version of the specified assembly name.

(继承自 ConfigurationElement)
GetTransformedTypeString(String)

返回指定类型名称的转换版本。Returns the transformed version of the specified type name.

(继承自 ConfigurationElement)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Init()

ConfigurationElement 对象设置为其初始状态。Sets the ConfigurationElement object to its initial state.

(继承自 ConfigurationElement)
InitializeDefault()

用于初始化 ConfigurationElement 对象的默认值集。Used to initialize a default set of values for the ConfigurationElement object.

(继承自 ConfigurationElement)
IsModified()

指示自上次在派生类中实现此配置元素时保存或加载以来是否对其进行过修改。Indicates whether this configuration element has been modified since it was last saved or loaded when implemented in a derived class.

(继承自 ConfigurationSection)
IsReadOnly()

获取一个值,该值指示 ConfigurationElement 对象是否为只读。Gets a value indicating whether the ConfigurationElement object is read-only.

(继承自 ConfigurationElement)
ListErrors(IList)

将此 ConfigurationElement 对象以及所有子元素中无效属性的错误添加到传递的列表中。Adds the invalid-property errors in this ConfigurationElement object, and in all subelements, to the passed list.

(继承自 ConfigurationElement)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnDeserializeUnrecognizedAttribute(String, String)

获取一个值,该值指示反序列化过程中是否遇到未知特性。Gets a value indicating whether an unknown attribute is encountered during deserialization.

(继承自 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

获取一个值,该值指示反序列化过程中是否遇到未知元素。Gets a value indicating whether an unknown element is encountered during deserialization.

(继承自 ConfigurationElement)
OnRequiredPropertyNotFound(String)

找不到所需属性时引发异常。Throws an exception when a required property is not found.

(继承自 ConfigurationElement)
PostDeserialize()

反序列化后调用。Called after deserialization.

(继承自 ConfigurationElement)
PreSerialize(XmlWriter)

在序列化之前调用。Called before serialization.

(继承自 ConfigurationElement)
Reset(ConfigurationElement)

重置 ConfigurationElement 对象的内部状态,包括锁和属性集合。Resets the internal state of the ConfigurationElement object, including the locks and the properties collections.

(继承自 ConfigurationElement)
ResetModified()

在派生类中实现时,将 IsModified() 方法的值重置为 falseResets the value of the IsModified() method to false when implemented in a derived class.

(继承自 ConfigurationSection)
SerializeElement(XmlWriter, Boolean)

当在派生类中实现后,将此配置元素的内容写入配置文件。Writes the contents of this configuration element to the configuration file when implemented in a derived class.

(继承自 ConfigurationElement)
SerializeSection(ConfigurationElement, String, ConfigurationSaveMode)

创建一个包含 ConfigurationSection 对象的分离视图的 XML 字符串,作为单独的节写入到文件中。Creates an XML string containing an unmerged view of the ConfigurationSection object as a single section to write to a file.

(继承自 ConfigurationSection)
SerializeToXmlElement(XmlWriter, String)

当在派生类中实现后,将此配置元素的外部标记写入配置文件。Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.

(继承自 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

将属性设置为指定值。Sets a property to the specified value.

(继承自 ConfigurationElement)
SetReadOnly()

设置 ConfigurationElement 对象及所有子元素的 IsReadOnly() 属性。Sets the IsReadOnly() property for the ConfigurationElement object and all subelements.

(继承自 ConfigurationElement)
ShouldSerializeElementInTargetVersion(ConfigurationElement, String, FrameworkName)

指示在为 .NET Framework.NET Framework 的指定目标版本序列化配置对象层次结构时,是否应序列化指定元素。Indicates whether the specified element should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.NET Framework.

(继承自 ConfigurationSection)
ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement)

指示在为指定目标版本的 .NET Framework.NET Framework 序列化配置对象层次结构时,是否应序列化指定属性。Indicates whether the specified property should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.NET Framework.

(继承自 ConfigurationSection)
ShouldSerializeSectionInTargetVersion(FrameworkName)

指示在为指定目标版本的 .NET Framework.NET Framework 序列化配置对象层次结构时,是否应序列化当前的 ConfigurationSection 实例。Indicates whether the current ConfigurationSection instance should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.NET Framework.

(继承自 ConfigurationSection)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

修改 ConfigurationElement 对象以移除所有不应该保存的值。Modifies the ConfigurationElement object to remove all values that should not be saved.

(继承自 ConfigurationElement)

适用于

另请参阅