Configuration.GetSection メソッド
メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。
指定した ConfigurationSection オブジェクトを返します。
名前空間: System.Configuration
アセンブリ: System.Configuration (system.configuration.dll 内)
構文
Dim instance As Configuration Dim sectionName As String Dim returnValue As ConfigurationSection returnValue = instance.GetSection(sectionName)


GetSection メソッドを使用してカスタム セクション情報にアクセスする方法を次のコード例に示します。
' Get a custom section. Shared Sub GetSection() Try Dim customSection As CustomSection ' Get the current configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) customSection = _ config.GetSection("CustomSection") Console.WriteLine( _ "Section name: {0}", _ customSection.SectionInformation.Name) Catch err As ConfigurationErrorsException Console.WriteLine(err.ToString()) End Try End Sub 'GetSection
// Get a custom section. static void GetSection() { try { CustomSection customSection; // Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None) as Configuration; customSection = config.GetSection("CustomSection") as CustomSection; Console.WriteLine("Section name: {0}", customSection.SectionInformation.Name); } catch (ConfigurationErrorsException err) { Console.WriteLine(err.ToString()); } }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- Configuration.GetSection メソッドのページへのリンク