This documentation is archived and is not being maintained.

DiscoveryClientResultCollection.Add Method

Adds a DiscoveryClientResult to the DiscoveryClientResultCollection.

[Visual Basic]
Public Function Add( _
   ByVal value As DiscoveryClientResult _
) As Integer
[C#]
public int Add(
 DiscoveryClientResult value
);
[C++]
public: int Add(
 DiscoveryClientResult* value
);
[JScript]
public function Add(
   value : DiscoveryClientResult
) : int;

Parameters

value
The DiscoveryClientResult to add to the DiscoveryClientResultCollection.

Return Value

The position into which the DiscoveryClientResult was inserted.

Example

[Visual Basic] 
' Initialize a new instance of the DiscoveryClientResult class.
Dim myDiscoveryClientResult As New DiscoveryClientResult()

' Set the type of reference in the discovery document as 
' DiscoveryDocumentReference.
myDiscoveryClientResult.ReferenceTypeName = _
    "System.Web.Services.Discovery.DiscoveryDocumentReference"

' Set the URL for the reference.
myDiscoveryClientResult.Url = _
    "http://localhost/Discovery/Service1_vb.asmx?disco"

' Set the name of the file in which the reference is saved.
myDiscoveryClientResult.Filename = "Service1_vb.disco"

' Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult)

[C#] 
// Initialize new instance of the DiscoveryClientResult class.
DiscoveryClientResult myDiscoveryClientResult =
    new DiscoveryClientResult();

// Set the type of reference in the discovery document as 
// DiscoveryDocumentReference.
myDiscoveryClientResult.ReferenceTypeName = 
    "System.Web.Services.Discovery.DiscoveryDocumentReference";

// Set the URL for the reference.
myDiscoveryClientResult.Url = 
    "http://localhost/Discovery/Service1_cs.asmx?disco";

// Set the name of the file in which the reference is saved.
myDiscoveryClientResult.Filename = "Service1_cs.disco";

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);

[C++] 
// Initialize new instance of the DiscoveryClientResult class.
DiscoveryClientResult* myDiscoveryClientResult =
   new DiscoveryClientResult();

// Set the type of reference in the discovery document as 
// DiscoveryDocumentReference.
myDiscoveryClientResult->ReferenceTypeName = 
   S"System.Web.Services.Discovery.DiscoveryDocumentReference";

// Set the URL for the reference.
myDiscoveryClientResult->Url = 
   S"http://localhost/Discovery/Service1_cs.asmx?disco";

// Set the name of the file in which the reference is saved.
myDiscoveryClientResult->Filename = S"Service1_cs.disco";

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection->Add(myDiscoveryClientResult);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DiscoveryClientResultCollection Class | DiscoveryClientResultCollection Members | System.Web.Services.Discovery Namespace | Add | DiscoveryClientResult | IList

Show: