HealthMonitoringSection.Providers 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 ProviderSettingsCollection 物件的 ProviderSettings 集合。
public:
property System::Configuration::ProviderSettingsCollection ^ Providers { System::Configuration::ProviderSettingsCollection ^ get(); };
[System.Configuration.ConfigurationProperty("providers")]
public System.Configuration.ProviderSettingsCollection Providers { get; }
[<System.Configuration.ConfigurationProperty("providers")>]
member this.Providers : System.Configuration.ProviderSettingsCollection
Public ReadOnly Property Providers As ProviderSettingsCollection
屬性值
ProviderSettingsCollection 集合。 預設為空的 ProviderSettingsCollection 集合。
- 屬性
範例
下列程式碼範例示範如何使用 Providers 屬性。 此程式碼範例是提供給 類別之較大範例的 HealthMonitoringSection 一部分。
// Display contents of the Providers collection property
Console.WriteLine("Providers Collection contains {0} values:",
healthMonitoringSection.Providers.Count);
// Display all elements.
for (System.Int32 i = 0; i < healthMonitoringSection.Providers.Count; i++)
{
System.Configuration.ProviderSettings provider =
healthMonitoringSection.Providers[i];
Console.WriteLine(" Item {0}: Name = '{1}' Type = '{2}'", i,
provider.Name, provider.Type);
}
' Display contents of the Providers collection property
Console.WriteLine("Providers Collection contains {0} values:", _
healthMonitoringSection.Providers.Count)
' Display all elements.
For i As System.Int32 = 0 To healthMonitoringSection.Providers.Count - 1
Dim providerStg As System.Configuration.ProviderSettings = _
healthMonitoringSection.Providers(i)
Console.WriteLine(" Item {0}: Name = '{1}' Type = '{2}'", i, _
providerStg.Name, providerStg.Type)
Next
備註
屬性 Providers 會指定哪一個提供者用於 屬性中 EventMappings 定義的事件。