NamespaceCollection.Remove(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從集合中移除 NamespaceInfo 包含指定金鑰的物件。
public:
void Remove(System::String ^ s);
public void Remove(string s);
member this.Remove : string -> unit
Public Sub Remove (s As String)
參數
- s
- String
要從集合中移除物件的命名空間 NamespaceInfo 。
例外狀況
範例
下列程式代碼範例示範如何使用 Remove 方法。 此程式碼範例是本類別更大範例 PagesSection 的一部分。
// Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections");
' Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections")
備註
若指定元素定義於較高階的設定檔中,此方法會在當前應用程式層級的適當區段插入元素 remove 。 若該元素在目前設定檔中定義,則其條目將從設定檔中移除。 要移除的物件必須存在於集合中;若不成功,則擲出 A ConfigurationException 。