共用方式為


WebPartsPersonalization.Providers 屬性

定義

取得 ProviderSettingsCollection 集合,內含目前 Web 應用程式的 Web 組件個人化提供者。

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 集合,內含目前 Web 應用程式的 Web 組件個人化提供者。

屬性

範例

下列程式碼範例示範如何使用 Providers 屬性。 此程式碼範例是針對 類別提供的較大範例的 WebPartsSection 一部分。

// Add a provider.
webPartsSection.Personalization.Providers.Add(
    new ProviderSettings("CustomProvider", 
    "MyCustomProviders.Provider"));

// List current providers.
for (int pi = 0; 
    pi < webPartsSection.Personalization.Providers.Count; pi++)
{
    Console.WriteLine("  #{0} Name={1} Type={2}", pi,
        webPartsSection.Personalization.Providers[pi].Name,
        webPartsSection.Personalization.Providers[pi].Type);
}
' Add a provider.
webPartsSection.Personalization.Providers.Add( _
  New ProviderSettings("CustomProvider", _
  "MyCustomProviders.Provider"))

' List current providers.
Dim pi As Integer
For pi = 0 To webPartsSection.Personalization.Providers.Count - 1
  Console.WriteLine("  #{0} Name={1} Type={2}", pi, _
    webPartsSection.Personalization.Providers(pi).Name, _
    webPartsSection.Personalization.Providers(pi).Type)
Next

備註

網頁元件個人化提供者只能在Web.config檔案) 中的 Web 應用層級 (定義。

適用於

另請參閱