ClientTargetCollection.Remove Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
ClientTarget Usuwa obiekt z kolekcji.
Przeciążenia
Remove(String) |
ClientTarget Usuwa obiekt z określonym aliasem z kolekcji. |
Remove(ClientTarget) |
Usuwa określony ClientTarget obiekt z kolekcji. |
Remove(String)
ClientTarget Usuwa obiekt z określonym aliasem z kolekcji.
public:
void Remove(System::String ^ name);
public void Remove (string name);
member this.Remove : string -> unit
Public Sub Remove (name As String)
Parametry
- name
- String
Alias elementu ClientTarget do usunięcia.
Przykłady
Poniższy przykład kodu usuwa ClientTarget obiekt z kolekcji ClientTargetCollection .
Aby uzyskać informacje o sposobie pobierania kolekcji, zobacz przykładowy kod w przeglądzie ClientTargetCollection klasy.
// 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
Uwagi
Metoda Remove usuwa add
element w clientTarget
sekcji na bieżącym poziomie hierarchii i wstawia remove
element. Element remove
skutecznie usuwa odwołanie do elementu zdefiniowanego add
w plikach konfiguracji nadrzędnej na wyższych poziomach w hierarchii, ale nie usuwa go.
Zobacz też
Dotyczy
Remove(ClientTarget)
Usuwa określony ClientTarget obiekt z kolekcji.
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)
Parametry
- clientTarget
- ClientTarget
Element ClientTarget do usunięcia.
Przykłady
Poniższy przykład kodu usuwa ClientTarget obiekt z kolekcji ClientTargetCollection .
Aby uzyskać informacje o sposobie pobierania kolekcji, zobacz przykładowy kod w przeglądzie ClientTargetCollection klasy.
// 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
Uwagi
Metoda Remove usuwa add
element w clientTarget
sekcji na bieżącym poziomie hierarchii i wstawia remove
element. Element remove
skutecznie usuwa odwołanie do elementu zdefiniowanego add
w plikach konfiguracji nadrzędnej na wyższych poziomach w hierarchii, ale nie usuwa go.