ConfigurationSection.SerializeSection 方法

定义

创建一个包含 ConfigurationSection 对象的分离视图的 XML 字符串,作为单独的节写入到文件中。

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 实例。

name
String

要创建的节的名称。

saveMode
ConfigurationSaveMode

写入到字符串中时要使用的 ConfigurationSaveMode 实例。

返回

XML 字符串,包含 ConfigurationSection 对象的分离视图。

注解

序列化是指将对象中包含的实时数据转换为 XML 格式,并将其存储转换为配置文件。

适用于