JHAppSettings.Get(Ttype) Method (String, Ttype)

DCSoft.DBUtilityGeneric

JHAppSettingsGetTtype Method (String, Ttype)
获取 AppSettings 中的指定键关联的值

Namespace: DCSoft.Utility.Configuration
Assembly: DCSoft.Utility (in DCSoft.Utility.dll) Version: 0.0.0.0 (1.0.0.0)
Syntax
C#
public static Ttype Get<Ttype>(
	string name,
	Ttype defaultValue
)
where Ttype : IConvertible

Parameters

name
Type: SystemString
appSettings 中配置的键的 name 值
defaultValue
Type: Ttype
默认值,当获取为 null 或异常时返回该值

Type Parameters

Ttype
要返回的数据类型,如 int, string, DateTime 等

Return Value

Type: Ttype
返回获取的配置信息的 value 的值
See Also