Share via


AppSettingsExpressionBuilder.GetAppSetting メソッド

定義

Web.config ファイルの <appSettings> セクションの値を返します。

オーバーロード

GetAppSetting(String)

Web.config ファイルの <appSettings> セクションの値を返します。

GetAppSetting(String, Type, String)

Web.config ファイルの <appSettings> セクションの値を対象の型に変換して返します。

GetAppSetting(String)

Web.config ファイルの <appSettings> セクションの値を返します。

public:
 static System::Object ^ GetAppSetting(System::String ^ key);
public static object GetAppSetting (string key);
static member GetAppSetting : string -> obj
Public Shared Function GetAppSetting (key As String) As Object

パラメーター

key
String

構成ファイルから取得する値のキー。

戻り値

Web.config ファイルの <appSettings> セクションのキーに関連付けられている Object

例外

キーが Web.config にありません。

注釈

このメソッドは、Web.config ファイルの セクションの <appSettings> キーと値のペアから適切な値を取得します。 キーをインデックスとして持つ プロパティを AppSettings 取得することで、値を取得します。 Object返される は 型Stringです。

こちらもご覧ください

適用対象

GetAppSetting(String, Type, String)

Web.config ファイルの <appSettings> セクションの値を対象の型に変換して返します。

public:
 static System::Object ^ GetAppSetting(System::String ^ key, Type ^ targetType, System::String ^ propertyName);
public static object GetAppSetting (string key, Type targetType, string propertyName);
static member GetAppSetting : string * Type * string -> obj
Public Shared Function GetAppSetting (key As String, targetType As Type, propertyName As String) As Object

パラメーター

key
String

構成ファイルから取得する値のキー。

targetType
Type

プロパティ エントリが格納されたオブジェクトの型。

propertyName
String

式をバインドする対象のプロパティの名前。

戻り値

Web.config ファイルの <appSettings> セクションのキーに関連付けられている Object

例外

キーが Web.config にありません。

- または -

戻り値を変換できませんでした。

注釈

このメソッドは、Web.config ファイルの セクションの <appSettings> キーと値のペアから適切な値を取得します。 値は、キーを AppSettings インデックスとして持つ プロパティを取得することによって取得されます。 結果の文字列値は、 パラメーターと propertyName パラメーターに基づいて新しい型にtargetType変換されます。

こちらもご覧ください

適用対象