ProfileSettingsCollection.IndexOf(String) Método

Definição

Devolve o índice do 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

O nome de um ProfileSettings objeto na coleção.

Devoluções

O índice do objeto especificado ProfileSettings , ou -1 se o objeto não for encontrado na coleção.

Exemplos

O exemplo de código a seguir mostra como usar o IndexOf método. Este exemplo de código faz parte de um exemplo maior fornecido para a HealthMonitoringSection classe.

// 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"))

Aplica-se a

Ver também