ProfileSettingsCollection.IndexOf(String) Metodo

Definizione

Restituisce l'indice dell'oggetto specificato 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

Parametri

name
String

Nome di un ProfileSettings oggetto nell'insieme.

Valori restituiti

Indice dell'oggetto specificato ProfileSettings o -1 se l'oggetto non viene trovato nell'insieme.

Esempio

Nell'esempio di codice seguente viene illustrato come usare il IndexOf metodo . Questo esempio di codice fa parte di un esempio più ampio fornito per la 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"))

Si applica a

Vedi anche