Freigeben über


ServiceDescriptionCollection.IndexOf-Methode

Sucht nach der angegebenen ServiceDescription und gibt den nullbasierten Index des ersten Vorkommens in der Auflistung zurück.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Function IndexOf ( _
    serviceDescription As ServiceDescription _
) As Integer
'Usage
Dim instance As ServiceDescriptionCollection
Dim serviceDescription As ServiceDescription
Dim returnValue As Integer

returnValue = instance.IndexOf(serviceDescription)
public int IndexOf (
    ServiceDescription serviceDescription
)
public:
int IndexOf (
    ServiceDescription^ serviceDescription
)
public int IndexOf (
    ServiceDescription serviceDescription
)
public function IndexOf (
    serviceDescription : ServiceDescription
) : int

Parameter

  • serviceDescription
    Die ServiceDescription, nach der in der Auflistung gesucht werden soll.

Rückgabewert

Eine 32-Bit-Ganzzahl mit Vorzeichen.

Beispiel

' Get the index of 'ServiceDescription' object.
Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)
' Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2)
Console.WriteLine("Element at index {0} is removed ", myIndex.ToString())
// Get the index of 'ServiceDescription' object.
int myIndex = myCollection.IndexOf(myServiceDescription2); 
// Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed ", myIndex);
// Get the index of 'ServiceDescription' object.
int myIndex = myCollection.IndexOf(myServiceDescription2);
// Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed ", 
    System.Convert.ToString(myIndex));
// Get the index of a ServiceDescription.
int myIndex = myCollection.IndexOf(myServiceDescription2);
// Remove a ServiceDescription from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed.",
    System.Convert.ToString(myIndex));

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ServiceDescriptionCollection-Klasse
ServiceDescriptionCollection-Member
System.Web.Services.Description-Namespace