ConfigurationManager.AppSettings プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ConfigurationManager.AppSettings プロパティの意味・解説 

ConfigurationManager.AppSettings プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

現在のアプリケーション既定構成の AppSettingsSection データ取得します

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

Public Shared ReadOnly Property
 AppSettings As NameValueCollection
Dim value As NameValueCollection

value = ConfigurationManager.AppSettings
public static NameValueCollection AppSettings
 { get; }
public:
static property NameValueCollection^ AppSettings {
    NameValueCollection^ get ();
}
/** @property */
public static NameValueCollection get_AppSettings
 ()
public static function get
 AppSettings () : NameValueCollection

プロパティ
現在のアプリケーション既定構成の、AppSettingsSection オブジェクト内容格納する NameValueCollection オブジェクト返します

例外例外
解説解説

AppSettingsSection オブジェクトには、構成ファイルappSettings セクション内容格納されます。

使用例使用例

AppSettings プロパティ使用して、名前付アプリケーション設定取得する方法次のコード例示します

' Get appSettings.
Shared Sub GetAppSettings()
   ' Get the appSettings.
     Dim appSettings As NameValueCollection
 = _
     ConfigurationManager.AppSettings
   
   ' Get the collection enumerator.
     Dim appSettingsEnum As IEnumerator = _
     appSettings.Keys.GetEnumerator()
   
   ' Loop through the collection and
   ' display the appSettings key, value pairs.
   Dim i As Integer = 0
   While appSettingsEnum.MoveNext()
      Dim key As String
 = appSettings.Keys(i)
         Console.WriteLine("Name: {0} Value: {1}",
 _
         key, appSettings(key))
      i += 1
   End While
End Sub 'GetAppSettings
 
// Get appSettings.
static void GetAppSettings()
{
    // Get the appSettings.
    NameValueCollection appSettings =
         ConfigurationManager.AppSettings;
    
    // Get the collection enumerator.
    IEnumerator appSettingsEnum =
        appSettings.Keys.GetEnumerator();

    // Loop through the collection and
    // display the appSettings key, value pairs.
    int i = 0;
    Console.WriteLine("App settings.");
    while (appSettingsEnum.MoveNext())
    {
        string key = appSettings.Keys[i];
        Console.WriteLine("Name: {0} Value: {1}",
        key, appSettings[key]);
        i += 1;
    }

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


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

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

辞書ショートカット

すべての辞書の索引

「ConfigurationManager.AppSettings プロパティ」の関連用語

ConfigurationManager.AppSettings プロパティのお隣キーワード
検索ランキング

   

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



ConfigurationManager.AppSettings プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS