AuthorizationRuleCollection.Remove(AuthorizationRule) Metod

Definition

Tar bort ett AuthorizationRule objekt från samlingen.

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)

Parametrar

rule
AuthorizationRule

Objektet som AuthorizationRule ska tas bort.

Undantag

Det skickade AuthorizationRule objektet finns inte i samlingen, elementet har redan tagits bort eller samlingen är skrivskyddad.

Exempel

I följande kodexempel visas hur metoden Remove används. Se kodexemplet i klassavsnittet AuthorizationSection för att lära dig hur du hämtar samlingen.

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

Kommentarer

Den här metoden infogar ett remove element i lämplig del av konfigurationsfilen för alla element som definierats i en konfigurationsfil på högre nivå. Om elementet definieras i lämpligt avsnitt i den aktuella konfigurationsfilen tas dess post bort från konfigurationsfilen. Det objekt som ska tas bort måste finnas i samlingen.

Gäller för