ConfigurationSection.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.

protected:
 virtual System::String ^ SerializeSection(System::Configuration::ConfigurationElement ^ parentElement, System::String ^ name, System::Configuration::ConfigurationSaveMode saveMode);
protected public:
 virtual System::String ^ SerializeSection(System::Configuration::ConfigurationElement ^ parentElement, System::String ^ name, System::Configuration::ConfigurationSaveMode saveMode);
protected virtual string SerializeSection (System.Configuration.ConfigurationElement parentElement, string name, System.Configuration.ConfigurationSaveMode saveMode);
protected internal virtual string SerializeSection (System.Configuration.ConfigurationElement parentElement, string name, System.Configuration.ConfigurationSaveMode saveMode);
abstract member SerializeSection : System.Configuration.ConfigurationElement * string * System.Configuration.ConfigurationSaveMode -> string
override this.SerializeSection : System.Configuration.ConfigurationElement * string * System.Configuration.ConfigurationSaveMode -> string
Protected Overridable Function SerializeSection (parentElement As ConfigurationElement, name As String, saveMode As ConfigurationSaveMode) As String
Protected Friend Overridable Function SerializeSection (parentElement As ConfigurationElement, name As String, saveMode As ConfigurationSaveMode) As String

参数

parentElement
ConfigurationElement

要在执行分离时充当父对象的 ConfigurationElement 实例。The ConfigurationElement instance to use as the parent when performing the un-merge.

name
String

要创建的节的名称。The name of the section to create.

saveMode
ConfigurationSaveMode

写入到字符串中时要使用的 ConfigurationSaveMode 实例。The ConfigurationSaveMode instance to use when writing to a string.

返回

String

XML 字符串,包含 ConfigurationSection 对象的分离视图。An XML string containing an unmerged view of the ConfigurationSection object.

注解

序列化是指将对象中包含的实时数据转换为 XML 格式,并将其存储到配置文件。Serialization refers to the transformation of real-time data, contained in an object, to XML format and its storage to a configuration file.

适用于