Bagikan melalui


ProfileSection.Providers Properti

Definisi

Mendapatkan kumpulan ProviderSettings objek.

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

Nilai Properti

ProviderSettingsCollection yang berisi penyedia yang ditentukan dalam providers subbagian profile bagian file konfigurasi.

Atribut

Contoh

Contoh kode berikut menunjukkan cara menggunakan Providers properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .


// Display all current Providers.
Console.WriteLine("Current Providers:");
int providerCtr = 0;
foreach (ProviderSettings provider in profileSection.Providers)
{
    Console.WriteLine("  {0}: Provider '{1}' of type '{2}'", ++providerCtr, 
        provider.Name, provider.Type);
}

// Add a new provider.
profileSection.Providers.Add(new ProviderSettings("AspNetSqlProvider", "...SqlProfileProvider"));

Console.WriteLine("Current Providers:")
Dim providerCtr As Integer = 0
For Each provider As ProviderSettings In profileSection.Providers
    Console.WriteLine("  {0}: Provider '{1}' of type '{2}'", ++providerCtr, _
        provider.Name, provider.Type)
Next

' Add a new provider.
profileSection.Providers.Add(new ProviderSettings("AspNetSqlProvider", "...SqlProfileProvider"))

Keterangan

Penyedia profil menunjuk ke sumber data tempat nilai profil pengguna disimpan. Anda dapat menentukan penyedia profil di providers subbagian profile bagian file konfigurasi.

Berlaku untuk

Lihat juga