ClientTargetCollection.Add(ClientTarget) 메서드

정의

컬렉션에 지정된 ClientTarget 개체를 추가합니다.

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

매개 변수

clientTarget
ClientTarget

ClientTarget 컬렉션에 추가할 개체입니다.

예제

다음 코드 예제에서는 컬렉션에 ClientTarget 개체를 추가합니다 ClientTargetCollection .

컬렉션을 가져오는 방법에 대한 자세한 내용은 클래스 개요의 코드 예제를 ClientTargetCollection 참조하세요.


// Create a new ClientTarget object.
clientTarget = new ClientTarget(
  "my alias", "My User Agent"); 
  
// Add the clientTarget to 
// the collection.
clientTargets.Add(clientTarget);

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

' Add the clientTarget to 
' the collection.
clientTargets.Add(clientTarget)

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

설명

컬렉션에 클라이언트 대상을 추가하기 전에 개체를 ClientTarget 만들고 해당 AliasUserAgent 개체 및 속성을 초기화해야 합니다.

적용 대상

추가 정보