ServiceDescriptionCollection.Add(ServiceDescription) 方法

定义

将指定的 ServiceDescription 添加到 ServiceDescriptionCollection 的结尾。

public:
 int Add(System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public int Add (System.Web.Services.Description.ServiceDescription serviceDescription);
member this.Add : System.Web.Services.Description.ServiceDescription -> int
Public Function Add (serviceDescription As ServiceDescription) As Integer

参数

serviceDescription
ServiceDescription

要添加到集合中的 ServiceDescription

返回

Int32

添加了 ServiceDescription 参数的位置的从零开始的索引。

示例

// Create a ServiceDescriptionCollection.
ServiceDescriptionCollection^ myCollection = gcnew ServiceDescriptionCollection;

// Add ServiceDescriptions to the collection.
myCollection->Add( myServiceDescription1 );
myCollection->Add( myServiceDescription2 );
// Create the object of 'ServiceDescriptionCollection' class.
ServiceDescriptionCollection myCollection =
   new ServiceDescriptionCollection();
// Add 'ServiceDescription' objects.
myCollection.Add(myServiceDescription1);
myCollection.Add(myServiceDescription2);
' Create the object of 'ServiceDescriptionCollection' class.
Dim myCollection As New ServiceDescriptionCollection()
' Add 'ServiceDescription' objects. 
myCollection.Add(myServiceDescription1)
myCollection.Add(myServiceDescription2)

适用于