Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Sucht nach dem angegebenen Service und gibt den nullbasierten Index des ersten Vorkommens in der ServiceCollection zurück.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Syntax
'Declaration
Public Function IndexOf ( _
service As Service _
) As Integer
'Usage
Dim instance As ServiceCollection
Dim service As Service
Dim returnValue As Integer
returnValue = instance.IndexOf(service)
public int IndexOf (
Service service
)
public:
int IndexOf (
Service^ service
)
public int IndexOf (
Service service
)
public function IndexOf (
service : Service
) : int
Parameter
- service
Der Service, nach dem in der Auflistung gesucht werden soll.
Rückgabewert
Eine 32-Bit-Ganzzahl mit Vorzeichen.
Beispiel
If myServiceDescription.Services.Contains(myService) Then
Console.WriteLine( _
"The mentioned service Exists at index {0} in the WSDL.", _
myServiceDescription.Services.IndexOf(myService))
Dim myServiceArray(myServiceDescription.Services.Count - 1) _
As Service
' Copy the services into an array.
myServiceDescription.Services.CopyTo(myServiceArray, 0)
Dim myEnumerator As IEnumerator = myServiceArray.GetEnumerator()
Console.WriteLine("The names of services in the array are")
While myEnumerator.MoveNext()
Dim myService1 As Service = CType(myEnumerator.Current, Service)
Console.WriteLine(myService1.Name)
End While
Else
Console.WriteLine("Service does not exist in the WSDL.")
End If
if(myServiceDescription.Services.Contains(myService))
{
Console.WriteLine(
"The mentioned service exists at index {0} in the WSDL.",
myServiceDescription.Services.IndexOf(myService));
Service[] myServiceArray =
new Service[myServiceDescription.Services.Count];
// Copy the services into an array.
myServiceDescription.Services.CopyTo(myServiceArray,0);
IEnumerator myEnumerator = myServiceArray.GetEnumerator();
Console.WriteLine("The names of services in the array are");
while(myEnumerator.MoveNext())
{
Service myService1 = (Service)myEnumerator.Current;
Console.WriteLine(myService1.Name);
}
}
else
{
Console.WriteLine("Service does not exist in the WSDL." );
}
if ( myServiceDescription->Services->Contains( myService ) )
{
Console::WriteLine( "The mentioned service exists at index {0} in the WSDL.", myServiceDescription->Services->IndexOf( myService ) );
array<Service^>^myServiceArray = gcnew array<Service^>(myServiceDescription->Services->Count);
// Copy the services into an array.
myServiceDescription->Services->CopyTo( myServiceArray, 0 );
IEnumerator^ myEnumerator = myServiceArray->GetEnumerator();
Console::WriteLine( "The names of services in the array are" );
while ( myEnumerator->MoveNext() )
{
Service^ myService1 = dynamic_cast<Service^>(myEnumerator->Current);
Console::WriteLine( myService1->Name );
}
}
else
{
Console::WriteLine( "Service does not exist in the WSDL." );
}
if (myServiceDescription.get_Services().Contains(myService)) {
Console.WriteLine("The mentioned service exists at index {0}"
+ "in the WSDL.",
System.Convert.ToString(myServiceDescription.get_Services().
IndexOf(myService)));
Service myServiceArray[] = new Service[myServiceDescription.
get_Services().get_Count()];
// Copy the services into an array.
myServiceDescription.get_Services().CopyTo(myServiceArray, 0);
IEnumerator myEnumerator = myServiceArray.GetEnumerator();
Console.WriteLine("The names of services in the array are");
while (myEnumerator.MoveNext()) {
Service myService1 = (Service)(myEnumerator.get_Current());
Console.WriteLine(myService1.get_Name());
}
}
else {
Console.WriteLine("Service does not exist in the WSDL.");
}
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
ServiceCollection-Klasse
ServiceCollection-Member
System.Web.Services.Description-Namespace