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

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

ConfigurationManager.GetSection メソッド

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

現在のアプリケーション既定構成の、指定した構成セクション取得します

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

Public Shared Function GetSection
 ( _
    sectionName As String _
) As Object
Dim sectionName As String
Dim returnValue As Object

returnValue = ConfigurationManager.GetSection(sectionName)
public static Object GetSection (
    string sectionName
)
public:
static Object^ GetSection (
    String^ sectionName
)
public static Object GetSection (
    String sectionName
)
public static function GetSection
 (
    sectionName : String
) : Object

パラメータ

sectionName

構成セクションパスと名前。

戻り値
指定した ConfigurationSection オブジェクトセクション存在しない場合null 参照 (Visual Basic では Nothing)。

例外例外
例外種類条件

ConfigurationErrorsException

構成ファイル読み込むことができませんでした

解説解説
使用例使用例

GetSection メソッド使用して構成カスタム セクション作成しアプリケーション構成ファイル保存する方法次のコード例示します

' Get the a custom section. Show how to use the
' GetSection method.
Shared Sub GetCustomSection()
    ' Get the custom section.
    Dim custSection As CustomSection = _
    ConfigurationManager.GetSection("CustomSection")
    
    ' Read the custom section.
    Console.WriteLine( _
    "File name: {0} MaxIdleTime: {1} MaxUsers: {2}",
 _
    custSection.FileName, custSection.MaxIdleTime, _
    custSection.MaxUsers)
End Sub 'GetCustomSection

// Get the a custom section. Show how to use the
// GetSection method.
static void GetCustomSection()
{
    // Get the custom section.
    CustomSection custSection = 
        ConfigurationManager.GetSection("CustomSection") as CustomSection;
    
    // Read the custom section.
    Console.WriteLine("File name: {0} MaxIdleTime: {1} MaxUsers: {2}",
        custSection.FileName, custSection.MaxIdleTime, 
        custSection.MaxUsers);

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


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

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

辞書ショートカット

すべての辞書の索引

「ConfigurationManager.GetSection メソッド」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS