Share via


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 元素插入組態檔的適當區段中,以取得較高層級組態檔中定義的任何專案。 如果專案是在目前組態檔的適當區段中定義,則會從組態檔中移除其專案。 要移除的物件必須存在於集合中。

適用於

另請參閱