AuthorizationRuleCollection.Remove(AuthorizationRule) メソッド

定義

AuthorizationRule オブジェクトをコレクションから削除します。

public:
 void Remove(System::Web::Configuration::AuthorizationRule ^ rule);
public void Remove(System.Web.Configuration.AuthorizationRule rule);
member this.Remove : System.Web.Configuration.AuthorizationRule -> unit
Public Sub Remove (rule As AuthorizationRule)

パラメーター

rule
AuthorizationRule

削除する AuthorizationRule オブジェクト。

例外

渡された AuthorizationRule オブジェクトがコレクションに存在しないか、要素が既に削除されているか、コレクションが読み取り専用です。

次のコード例は、 Remove メソッドの使用方法を示しています。 コレクションを取得する方法については、 AuthorizationSection クラスのトピックのコード例を参照してください。

// Remove the rule from the collection.
authorizationSection.Rules.Remove(authorizationRule);
' Remove the rule from the collection.
authorizationSection.Rules.Remove(authorizationRule)

注釈

このメソッドは、上位レベルの構成ファイルで定義されているすべての要素の構成ファイルの適切なセクションに、 remove 要素を挿入します。 要素が現在の構成ファイルの適切なセクションで定義されている場合、そのエントリは構成ファイルから削除されます。 削除するオブジェクトはコレクション内に存在する必要があります。

適用対象