Lenguaje

ProfileSettingsCollection.IndexOf(String) Método

Definición

Devuelve el índice del objeto especificado ProfileSettings .

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 ProfileSettings objeto de la colección.

Devoluciones

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

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el IndexOf método . 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