ProtectedConfigurationSection クラス
アセンブリ: System.Configuration (system.configuration.dll 内)


configProtectedData 構成ファイル セクションの providers 要素には、保護されたデータ プロバイダのコレクションが格納されます。
![]() |
---|
Aspnet_regiis.exe ツールを使用して、構成セクションを暗号化および復号化できます。詳細については、保護された構成を使用した構成情報の暗号化 のトピックを参照してください。 |

次の構成ファイルの抜粋に、保護されているデータ プロバイダを宣言によって指定する方法を示します。
<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.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Configuration.ProtectedConfigurationSection


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ProtectedConfigurationSection コンストラクタ
アセンブリ: System.Configuration (system.configuration.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 現在の ConfigurationElement インスタンスを、指定したオブジェクトと比較します。 ( ConfigurationElement から継承されます。) |
![]() | GetHashCode | 現在の ConfigurationElement インスタンスを表す一意の値を取得します。 ( ConfigurationElement から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsReadOnly | ConfigurationElement オブジェクトが読み取り専用かどうかを示す値を取得します。 ( ConfigurationElement から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ProtectedConfigurationSection メンバ
configProtectedData 構成セクションにプログラムからアクセスできるようにします。このクラスは継承できません。
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 から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 現在の ConfigurationElement インスタンスを、指定したオブジェクトと比較します。 (ConfigurationElement から継承されます。) |
![]() | GetHashCode | 現在の ConfigurationElement インスタンスを表す一意の値を取得します。 (ConfigurationElement から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsReadOnly | ConfigurationElement オブジェクトが読み取り専用かどうかを示す値を取得します。 (ConfigurationElement から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からProtectedConfigurationSectionを検索する場合は、下記のリンクをクリックしてください。

- ProtectedConfigurationSectionのページへのリンク