NamespaceCollection.Remove(String) 方法

定义

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

例外

集合中没有 NamespaceInfo 具有指定键的对象。

-或-

该元素已被删除。

-或-

集合为只读。

示例

下面的代码示例演示如何使用 Remove 该方法。 该代码示例是 PagesSection 类中的一个较大示例的一部分。

// Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections");
' Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections")

注解

如果在较高级别的配置文件中定义了指定的元素,此方法会将元素 remove 插入到当前应用程序级别的配置文件的相应节中。 如果元素在当前配置文件中定义,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中;如果不是,则会引发 a ConfigurationException

适用于

另请参阅