次の方法で共有


profile の providers の clear 要素 (ASP.NET 設定スキーマ)

ユーザー プロファイル プロバイダーのコレクションからすべてのプロファイル プロバイダーのインスタンスを削除します。

この要素は、.NET Framework Version 2.0 で追加されました。

<clear/>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

なし。

親要素

要素

説明

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルで必要なルート要素を指定します。

system.web

ASP.NET 構成セクションのルート要素を指定します。

profile

アプリケーションのユーザー プロファイルを構成します。

providers

ユーザー プロファイルのプロファイル プロバイダーのコレクションを定義します。

解説

アプリケーション コード内の profile 要素の構成値のアクセスおよび変更方法については、ProfileSection クラスを参照してください。

使用例

プロファイル情報の格納と取得に SqlProfileProvider を使用する ASP.NET アプリケーションを構成する方法を次のコード例に示します。 <clear> 要素は、SqlProfileProvider を追加する前に ProfileProviderCollection コレクションを削除します。

<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>

要素情報

構成セクション ハンドラー

System.Web.Configuration.ProfileSection

構成メンバー

ProfileSection.Providers

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

要件

Microsoft Internet Information Services (IIS) バージョン 5.0、5.1、または 6.0

.NET Framework Version 2.0

Microsoft Visual Studio 2005

参照

処理手順

方法 : ASP.NET 構成設定をロックする

参照

profile 要素 (ASP.NET 設定スキーマ)

system.web 要素 (ASP.NET 設定スキーマ)

<configuration> 要素

profile の providers の add 要素 (ASP.NET 設定スキーマ)

profile の providers の remove 要素 (ASP.NET 設定スキーマ)

ProfileSection

System.Configuration

System.Web.Configuration

概念

ASP.NET プロファイル プロパティの概要

ASP.NET 構成の概要

ASP.NET Web サーバー コントロールとブラウザーの機能

ASP.NET 構成の保護

ASP.NET の構成のシナリオ

その他の技術情報

ASP.NET 構成ファイル

ASP.NET 構成設定

全般構成設定 (ASP.NET)

ASP.NET 構成 API