ProtectedConfigurationSectionとは? わかりやすく解説

ProtectedConfigurationSection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

configProtectedData 構成セクションプログラムかアクセスできるようにします。このクラス継承できません。

名前空間: System.Configuration
アセンブリ: System.Configuration (system.configuration.dll 内)
構文構文

Public NotInheritable Class
 ProtectedConfigurationSection
    Inherits ConfigurationSection
Dim instance As ProtectedConfigurationSection
public sealed class ProtectedConfigurationSection
 : ConfigurationSection
public ref class ProtectedConfigurationSection
 sealed : public ConfigurationSection
public final class ProtectedConfigurationSection
 extends ConfigurationSection
public final class ProtectedConfigurationSection
 extends ConfigurationSection
解説解説
使用例使用例

次の構成ファイル抜粋に、保護されているデータ プロバイダ宣言によって指定する方法示します

<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
  <providers>
    <clear />
      <add keyContainerName="NetFrameworkConfigurationKey" cspProviderName=""
 useMachineContainer="true" useOAEP="false" description="Uses RsaCryptoServiceProvider
 to encrypt and decrypt" name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0,
 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      <add useMachineProtection="true" description="Uses CryptProtectData and
 CryptUnProtectData Windows APIs to encrypt and decrypt" keyEntropy="" name="DataProtectionConfigurationProvider"
 type="System.Configuration.DpapiProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

  </providers>
</configProtectedData>

ProtectedConfigurationSection クラス使用してconfigProtectedData 構成ファイル セクション含まれる値にプログラムによってアクセスする方法次のコード例示します

Imports System
Imports System.IO
Imports System.Configuration


' Shows how to use ProtectedConfigurationSection.

Class UsingProtectedConfigurationSection
    
    
    Shared Sub GetDefaultProvider() 
        Try
            ' Get the application configuration.
            Dim config As Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)
            
            ' Get the protected configuration section.
            Dim pcSection _
            As ProtectedConfigurationSection = _
            CType(config.GetSection( _
            "configProtectedData"), _
            System.Configuration.ProtectedConfigurationSection)
            
            ' Get the current DefaultProvider.
            Console.WriteLine( _
            "Protected configuration section default provider:")
            Console.WriteLine("{0}", _
            pcSection.DefaultProvider)
        
        Catch e As ConfigurationErrorsException
            Console.WriteLine(e.ToString())
        End Try
    
    End Sub 'GetDefaultProvider
     
    
    Shared Sub GetProviderCollection() 
        
        Try
            ' Get the application configuration.
            Dim config As Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            ' Get the protected configuration section.
            Dim pcSection _
            As ProtectedConfigurationSection = _
            CType(config.GetSection( _
            "configProtectedData"), _
            System.Configuration.ProtectedConfigurationSection)

            Console.WriteLine( _
            "Protected configuration section providers:")
            Dim ps As ProviderSettings
            For Each ps In
  pcSection.Providers
                Console.WriteLine("  {0}", ps.Name)
            Next ps
        
        Catch e As ConfigurationErrorsException
            Console.WriteLine(e.ToString())
        End Try
    
    End Sub 'GetProviderCollection
     

    Public Shared Sub Main()
 
        GetDefaultProvider()
        GetProviderCollection()
    
    End Sub 'Main
End Class 'UsingProtectedConfigurationSection
using System;
using System.IO;
using System.Configuration;

namespace Samples.Aspnet
{
    // Shows how to use ProtectedConfigurationSection.
    class UsingProtectedConfigurationSection
    {

        static void GetDefaultProvider()
        {
            try
            {
                // Get the application configuration.
                Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

                // Get the protected configuration section.
                ProtectedConfigurationSection pcSection =
                    (System.Configuration.ProtectedConfigurationSection)
                    config.GetSection("configProtectedData");

                // Get the current DefaultProvider.
                Console.WriteLine(
                    "Protected configuration section default
 provider:");
                Console.WriteLine("  {0}", pcSection.DefaultProvider);

            }
            catch (ConfigurationErrorsException e)
            {
                Console.WriteLine(e.ToString());
            }

        }


        static void GetProviderCollection()
        {

            try
            {
                // Get the application configuration.
                Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

                // Get the protected configuration section.
                ProtectedConfigurationSection pcSection =
                    (System.Configuration.ProtectedConfigurationSection)
                    config.GetSection("configProtectedData");

                Console.WriteLine(
               "Protected configuration section providers:");
                foreach (ProviderSettings ps in
                pcSection.Providers)
                {
                    Console.WriteLine("  {0}", ps.Name);
                }

            }
            catch (ConfigurationErrorsException e)
            {
                Console.WriteLine(e.ToString());
            }

        }

        public static void
 Main()
        {
            GetDefaultProvider();
            GetProviderCollection();
        }
    }
} 
継承階層継承階層
System.Object
   System.Configuration.ConfigurationElement
     System.Configuration.ConfigurationSection
      System.Configuration.ProtectedConfigurationSection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ProtectedConfigurationSection コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

既定設定使用して ProtectedConfigurationSection クラス新しインスタンス初期化します。

名前空間: System.Configuration
アセンブリ: System.Configuration (system.configuration.dll 内)
構文構文

Dim instance As New ProtectedConfigurationSection
public ProtectedConfigurationSection ()
public:
ProtectedConfigurationSection ()
public ProtectedConfigurationSection ()
public function ProtectedConfigurationSection
 ()
解説解説

ProtectedConfigurationSection コンストラクタは、コード直接使用するためのものではありません。ASP.NET 構成システムによって呼び出されます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ProtectedConfigurationSection クラス
ProtectedConfigurationSection メンバ
System.Configuration 名前空間

ProtectedConfigurationSection プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ DefaultProvider Providers コレクション プロパティ既定の ProtectedConfigurationProvider オブジェクトの名前を取得します
パブリック プロパティ ElementInformation  ConfigurationElement オブジェクトカスタマイズできない情報機能格納する ElementInformation オブジェクト取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAllAttributesExcept  ロックされている属性コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAllElementsExcept  ロックされている要素コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAttributes  ロックされている属性コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockElements  ロックされている要素コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockItem  要素ロックされているかどうかを示す値を取得または設定します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ Providers 参加しているすべての構成ファイル内のすべての ProtectedConfigurationProvider オブジェクトの ProviderSettingsCollection コレクション取得します
パブリック プロパティ SectionInformation  ConfigurationSection オブジェクトカスタマイズできない情報機能格納する SectionInformation オブジェクト取得します。 ( ConfigurationSection から継承されます。)
参照参照

関連項目

ProtectedConfigurationSection クラス
System.Configuration 名前空間
ProtectedConfiguration クラス
ProtectedConfigurationProvider クラス
ProtectedConfigurationProviderCollection クラス
ProtectedProviderSettings

その他の技術情報

暗号サービス
保護され構成使用した構成情報の暗号化
チュートリアル : 保護され構成使用した構成情報の暗号化

ProtectedConfigurationSection メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ProtectedConfigurationSection クラス
System.Configuration 名前空間
ProtectedConfiguration クラス
ProtectedConfigurationProvider クラス
ProtectedConfigurationProviderCollection クラス
ProtectedProviderSettings

その他の技術情報

暗号サービス
保護され構成使用した構成情報の暗号化
チュートリアル : 保護され構成使用した構成情報の暗号化

ProtectedConfigurationSection メンバ

configProtectedData 構成セクションプログラムかアクセスできるようにします。このクラス継承できません。

ProtectedConfigurationSection データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ProtectedConfigurationSection 既定設定使用して ProtectedConfigurationSection クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ DefaultProvider Providers コレクション プロパティ既定の ProtectedConfigurationProvider オブジェクトの名前を取得します
パブリック プロパティ ElementInformation  ConfigurationElement オブジェクトカスタマイズできない情報機能格納する ElementInformation オブジェクト取得します。 (ConfigurationElement から継承されます。)
パブリック プロパティ LockAllAttributesExcept  ロックされている属性コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockAllElementsExcept  ロックされている要素コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockAttributes  ロックされている属性コレクション取得します。 (ConfigurationElement から継承されます。)
パブリック プロパティ LockElements  ロックされている要素コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockItem  要素ロックされているかどうかを示す値を取得または設定します。(ConfigurationElement から継承されます。)
パブリック プロパティ Providers 参加しているすべての構成ファイル内のすべての ProtectedConfigurationProvider オブジェクトの ProviderSettingsCollection コレクション取得します
パブリック プロパティ SectionInformation  ConfigurationSection オブジェクトカスタマイズできない情報機能格納する SectionInformation オブジェクト取得します。 (ConfigurationSection から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ProtectedConfigurationSection クラス
System.Configuration 名前空間
ProtectedConfiguration クラス
ProtectedConfigurationProvider クラス
ProtectedConfigurationProviderCollection クラス
ProtectedProviderSettings

その他の技術情報

暗号サービス
保護され構成使用した構成情報の暗号化
チュートリアル : 保護され構成使用した構成情報の暗号化


このページでは「.NET Framework クラス ライブラリ リファレンス」からProtectedConfigurationSectionを検索した結果を表示しています。
Weblioに収録されているすべての辞書からProtectedConfigurationSectionを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からProtectedConfigurationSection を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ProtectedConfigurationSection」の関連用語

ProtectedConfigurationSectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ProtectedConfigurationSectionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS