BufferModesCollection.Remove(String) 方法

定义

从集合中移除 BufferModeSettings 对象。

public:
 void Remove(System::String ^ s);
public void Remove (string s);
member this.Remove : string -> unit
Public Sub Remove (s As String)

参数

s
String

集合中 BufferModeSettings 对象的名称。

例外

集合中不存在任何具有指定键的 BufferModeSettings 对象,该元素已移除或该集合为只读。

示例

下面的代码示例说明如何使用 Remove 方法。 此代码示例是为类提供的大型示例的 HealthMonitoringSection 一部分。

// Remove a BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Remove("Error Log");
' Remove a BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Remove("Error Log")

注解

此方法将 remove 元素插入到配置文件的相应节中,用于在更高级别的配置文件中定义的任何元素。 如果元素在当前配置文件的相应部分中定义,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中。

适用于

另请参阅