ClientTargetCollection.Remove Metod

Definition

Tar bort ett ClientTarget objekt från samlingen.

Överlagringar

Name Description
Remove(String)

Tar bort objektet ClientTarget med det angivna aliaset från samlingen.

Remove(ClientTarget)

Tar bort det angivna ClientTarget objektet från samlingen.

Remove(String)

Tar bort objektet ClientTarget med det angivna aliaset från samlingen.

public:
 void Remove(System::String ^ name);
public void Remove(string name);
member this.Remove : string -> unit
Public Sub Remove (name As String)

Parametrar

name
String

Aliaset för att ClientTarget ta bort.

Exempel

Följande kodexempel tar ClientTarget bort objektet från ClientTargetCollection samlingen.

Information om hur du hämtar samlingen finns i kodexemplet i klassöversikten ClientTargetCollection .


// Remove the client target with the
// specified alias from the collection
// (if exists).
clientTargets.Remove("my alias");

// Update the configuration file.
if (!clientTargetSection.IsReadOnly())
  configuration.Save();
' Remove the client target with the
' specified alias from the collection
' (if exists).
clientTargets.Remove("my alias")

' Update the configuration file.
If Not clientTargetSection.IsReadOnly() Then
    configuration.Save()
End If

Kommentarer

Metoden Remove tar bort elementet addclientTarget i avsnittet på den aktuella hierarkinivån och infogar ett remove element. Elementet remove tar effektivt bort referensen till elementet add som definierats i de överordnade konfigurationsfilerna på högre nivåer i hierarkin men tar inte bort det.

Se även

Gäller för

Remove(ClientTarget)

Tar bort det angivna ClientTarget objektet från samlingen.

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

Parametrar

clientTarget
ClientTarget

Att ClientTarget ta bort.

Exempel

Följande kodexempel tar ClientTarget bort objektet från ClientTargetCollection samlingen.

Information om hur du hämtar samlingen finns i kodexemplet i klassöversikten ClientTargetCollection .


// Create a ClientTarget object.
clientTarget = new ClientTarget(
  "my alias", "My User Agent");

// Remove it from the collection
// (if exists).
clientTargets.Remove(clientTarget);

// Update the configuration file.
if (!clientTargetSection.IsReadOnly())
  configuration.Save();
' Create a ClientTarget object.
clientTarget = New ClientTarget( _
"my alias", "My User Agent")

' Remove it from the collection
' (if exists).
clientTargets.Remove(clientTarget)

' Update the configuration file.
If Not clientTargetSection.IsReadOnly() Then
    configuration.Save()
End If

Kommentarer

Metoden Remove tar bort elementet addclientTarget i avsnittet på den aktuella hierarkinivån och infogar ett remove element. Elementet remove tar effektivt bort referensen till elementet add som definierats i de överordnade konfigurationsfilerna på högre nivåer i hierarkin men tar inte bort det.

Se även

Gäller för