SectionInformation.UnprotectSection メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SectionInformation.UnprotectSection メソッドの意味・解説 

SectionInformation.UnprotectSection メソッド

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

関連付けられている構成セクション保護され構成暗号化解除します

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

Public Sub UnprotectSection
Dim instance As SectionInformation

instance.UnprotectSection
public void UnprotectSection ()
public:
void UnprotectSection ()
public void UnprotectSection ()
public function UnprotectSection ()
解説解説
使用例使用例

UnprotectSection メソッド使用する方法の例を次に示します

Public Shared Sub UnProtectSection()
 
    
    ' Get the current configuration file.
    Dim config _
    As System.Configuration.Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)

    ' Get the section.
    Dim section As UrlsSection = _
    CType(config.GetSection("MyUrls"), UrlsSection)
    
    ' Unprotect (decrypt)the section.
    section.SectionInformation.UnprotectSection()
    
    ' Force the section information to be written to
    ' the configuration file.
    section.SectionInformation.ForceDeclaration(True)

    ' Save the decrypted section.
    section.SectionInformation.ForceSave = True
    
    config.Save(ConfigurationSaveMode.Full)
    
    ' Display the decrypted configuration 
    ' section. 
    Dim sectionXml As String
 = _
    section.SectionInformation.GetRawXml()
    
    Console.WriteLine("Decrypted section:")
    Console.WriteLine(sectionXml)

End Sub 'UnProtectSection 
static public void UnProtectSection()
{

    // Get the current configuration file.
    System.Configuration.Configuration config =
            ConfigurationManager.OpenExeConfiguration(
            ConfigurationUserLevel.None);


    // Get the section.
    UrlsSection section =
        (UrlsSection)config.GetSection("MyUrls");


    // Unprotect (decrypt)the section.
    section.SectionInformation.UnprotectSection();

    // Force the section information to be written to
    // the configuration file.
    section.SectionInformation.ForceDeclaration(true);

    // Save the decrypted section.
    section.SectionInformation.ForceSave = true;

    config.Save(ConfigurationSaveMode.Full);

    // Display the decrypted configuration 
    // section. 
    string sectionXml =
        section.SectionInformation.GetRawXml();

    Console.WriteLine("Decrypted section:");
    Console.WriteLine(sectionXml);

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

SectionInformation.UnprotectSection メソッドのお隣キーワード
検索ランキング

   

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



SectionInformation.UnprotectSection メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS