ProfileSettingsCollection.IndexOf(String) Método

Definición

Devuelve el índice del objeto ProfileSettings especificado.

public:
 int IndexOf(System::String ^ name);
public int IndexOf (string name);
member this.IndexOf : string -> int
Public Function IndexOf (name As String) As Integer

Parámetros

name
String

Nombre de un objeto ProfileSettings de la colección.

Devoluciones

Int32

El índice del objeto ProfileSettings especificado, o -1 si el objeto no se encuentra en la colección.

Ejemplos

En el ejemplo de código siguiente, se muestra cómo se utiliza el método IndexOf. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la HealthMonitoringSection clase .

// Get the index of the 'Default' ProfileSettings in the Profiles collection property.
Console.WriteLine("Profiles index for 'Default': {0}.",
    healthMonitoringSection.Profiles.IndexOf("Default"));
' Get the index of the 'Default' ProfileSettings in the Profiles collection property.
Console.WriteLine("Profiles index for 'Default': {0}.", _
    healthMonitoringSection.Profiles.IndexOf("Default"))

Se aplica a

Consulte también