Share via


providers-Element für profile (ASP.NET-Einstellungsschema)

Definiert eine Auflistung von Profilanbietern für das Benutzerprofil.

Dieses Element ist neu in .NET Framework, Version 2.0.

<providers>
    <add... />
    <remove.../>
    <clear/>
</providers>

Attribute und Elemente

In den folgenden Abschnitten werden Attribute, untergeordnete Elemente und übergeordnete Elemente beschrieben.

Attribute

Keine.

Untergeordnete Elemente

Element

Beschreibung

add

Optionales Element

Fügt der Auflistung von Profilanbietern einen Anbieter hinzu.

clear

Optionales Element

Entfernt einen Anbieter aus der Auflistung von Profilanbietern.

remove

Optionales Element

Löscht alle vorher definierten Profilanbieter aus der Auflistung.

Übergeordnete Elemente

Element

Beschreibung

configuration

Gibt das erforderliche Stammelement in jeder Konfigurationsdatei an, die von der Common Language Runtime und den .NET Framework-Anwendungen verwendet wird.

system.web

Gibt das Stammelement für den ASP.NET-Konfigurationsabschnitt an.

profile

Konfiguriert das Benutzerprofil für eine Anwendung.

Hinweise

Informationen darüber, wie Sie im Anwendungscode auf Konfigurationswerte für das profile-Element zugreifen und diese ändern können, finden Sie unter ProfileSection.

Standardkonfiguration

Das folgende profile-Standardelement wird in der Datei Machine.config von .NET Framework, Version 2.0, konfiguriert.

  <providers>
    <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>

Beispiel

Das folgende Codebeispiel zeigt, wie die Datei Web.config einer ASP.NET-Anwendung für die Verwendung eines benutzerdefinierten SqlProfileProvider-Anbieters konfiguriert wird.

<configuration>
  <connectionStrings>
    <add name="SqlServices" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial 
         Catalog=aspnetdb;" />
  </connectionStrings>

  <system.web>
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
    </authentication>

    <authorization>
      <deny users="?" />
    </authorization>

    <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="SqlProvider" 
             type="System.Web.Security.SqlMembershipProvider" 
             connectionStringName="SqlServices"
             applicationName="SampleApplication"
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             passwordFormat="Encrypted"
             requiresQuestionAndAnswer="true" />
      </providers>
    </membership>

    <profile defaultProvider="SqlProvider">
      <providers>
        <clear />
        <add name="SqlProvider"
             type="System.Web.Profile.SqlProfileProvider"
             connectionStringName="SqlServices"
             applicationName="SampleApplication"
             description="SqlProfileProvider for SampleApplication" />
      </providers>

      <properties>
        <add name="ZipCode" />
        <add name="CityAndState" />
      </properties>
    </profile>
  </system.web>
</configuration>

Elementinformationen

Konfigurationsabschnittshandler

System.Web.Configuration.ProfileSection

Konfigurationsmember

ProfileSection.Providers

Konfigurierbare Speicherorte

Machine.config

Web.config auf der Stammebene

Web.config auf der Anwendungsebene

Anforderungen

Microsoft Internetinformationsdienste (IIS), Version 5.0, 5.1 oder 6.0

.NET Framework, Version 2.0

Microsoft Visual Studio 2005

Siehe auch

Aufgaben

Gewusst wie: Sperren von ASP.NET-Konfigurationseinstellungen

Referenz

profile-Element (ASP.NET-Einstellungsschema)

system.web-Element (ASP.NET-Einstellungsschema)

<configuration>-Element

add-Element für providers für profile (ASP.NET-Einstellungsschema)

remove-Element für providers für profile (ASP.NET-Einstellungsschema)

clear-Element für providers für profile (ASP.NET-Einstellungsschema)

ProfileSection

System.Configuration

System.Web.Configuration

Konzepte

Übersicht über ASP.NET-Profileigenschaften

Übersicht über die ASP.NET-Konfiguration

ASP.NET-Webserversteuerelemente und Browserfunktionen

Absichern der ASP.NET-Konfiguration

ASP.NET-Konfigurationsszenarios

Weitere Ressourcen

ASP.NET-Konfigurationsdateien

ASP.NET-Konfigurationseinstellungen

Allgemeine Konfigurationseinstellungen (ASP.NET)

ASP.NET-Konfigurations-API