ClientTargetCollection.Remove メソッド

定義

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

オーバーロード

名前 説明
Remove(String)

指定したエイリアスを持つ ClientTarget オブジェクトをコレクションから削除します。

Remove(ClientTarget)

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

Remove(String)

指定したエイリアスを持つ ClientTarget オブジェクトをコレクションから削除します。

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

パラメーター

name
String

削除する ClientTarget のエイリアス。

次のコード例では、ClientTarget コレクションからClientTargetCollection オブジェクトを削除します。

コレクションを取得する方法については、 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

注釈

Remove メソッドは、現在の階層レベルのadd セクションのclientTarget要素を削除し、remove要素を挿入します。 remove要素は、階層の上位レベルにある親構成ファイルで定義されているadd要素への参照を実質的に削除しますが、削除しません。

こちらもご覧ください

適用対象

Remove(ClientTarget)

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

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)

パラメーター

clientTarget
ClientTarget

削除する ClientTarget

次のコード例では、ClientTarget コレクションからClientTargetCollection オブジェクトを削除します。

コレクションを取得する方法については、 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

注釈

Remove メソッドは、現在の階層レベルのadd セクションのclientTarget要素を削除し、remove要素を挿入します。 remove要素は、階層の上位レベルにある親構成ファイルで定義されているadd要素への参照を実質的に削除しますが、削除しません。

こちらもご覧ください

適用対象