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

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

WebConfigurationManager.AppSettings プロパティ

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

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

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

Public Shared ReadOnly Property
 AppSettings As NameValueCollection
Dim value As NameValueCollection

value = WebConfigurationManager.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

プロパティ
現在の Web アプリケーション既定構成AppSettingsSection オブジェクト格納している NameValueCollection オブジェクト

例外例外
解説解説

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

使用例使用例

AppSettings メソッド使用して構成情報アクセスする方法次のコード例示します

' Show the use of AppSettings. 
' It gets the section from the configuration 
' file located at the application current level. 
Shared Sub GetAppSettings()
   
   ' Get the appSettings key,value pairs collection.
     Dim appSettings As NameValueCollection
 = _
     WebConfigurationManager.AppSettings
   
   ' Get the collection enumerator.
     Dim appSettingsEnum As IEnumerator = _
     appSettings.GetEnumerator()
   
   ' Loop through the collection and 
   ' display the appSettings key, value pairs.
   Dim i As Integer = 0
   Console.WriteLine("[Display appSettings]")
   While appSettingsEnum.MoveNext()
      Dim key As String
 = appSettings.AllKeys(i)
         Console.WriteLine("Key: {0} Value: {1}",
 _
         key, appSettings(key))
      i += 1
   End While
   
   Console.WriteLine()
End Sub 'GetAppSettings


// Show the use of AppSettings. 
// It gets the section from the configuration 
// file located at the application current level. 
static void GetAppSettings()
{

    // Get the appSettings key,value pairs collection.
    NameValueCollection appSettings =
        WebConfigurationManager.AppSettings
        as NameValueCollection;

    // Get the collection enumerator.
    IEnumerator appSettingsEnum =
        appSettings.GetEnumerator();

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

    Console.WriteLine();
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebConfigurationManager クラス
WebConfigurationManager メンバ
System.Web.Configuration 名前空間
AppSettingsSection
NameValueCollection
その他の技術情報
appSettings 要素 (全般設定スキーマ)


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

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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS