C# Class Utility.Setting

配置信息类,该类为静态类,直接使用即可. 配置的key不区分大小写
FileName: Setting.cs CLRVersion: 4.0.30319.18444 Author: Devin DateTime: 2016/1/24 21:49:44 GitHub: https://github.com/v5bep7/Utility
Afficher le fichier Open project: v5bep7/Utility

Méthodes publiques

Méthode Description
GetBoolean ( string key, bool def = default(bool) ) : bool

获取bool型类型配置信息值

GetByte ( string key, byte def = default(byte) ) : byte

获取byte类型的配置信息

GetChar ( string key, char def = default(char) ) : char

获取char类型配置信息值

GetDateTime ( string key, System.DateTime def = default(DateTime) ) : System.DateTime

获取DataTime类型配置信息值

GetDecimal ( string key, decimal def = default(decimal) ) : decimal

获取decimal类型的配置信息

GetDouble ( string key, double def = default(double) ) : double

获取double类型的配置信息

GetFloat ( string key, float def = default(float) ) : float

获取float类型的配置信息

GetGuid ( string key, System.Guid def = default(Guid) ) : System.Guid

获取Guid类型配置信息值

GetInt ( string key, int def = default(int) ) : int

获取int类型的配置信息值

GetLong ( string key, long def = default(long) ) : long

获取long类型的配置信息值

GetShort ( string key, short def = default(short) ) : short

获取short类型的配置信息

GetString ( string key, string def = "" ) : string

获取字符串类型设置信息

Load ( string path ) : void

从文件加载配置信息

Remove ( ) : void

移除配置仓储里面的多个配置信息

Remove ( string key ) : void

根据key移除配置仓储里面的配置信息

Save ( string path ) : void

将配置信息保存到文件

Set ( string>.IDictionary data ) : void

设置配置信息. 往配置仓储添加配置,如果仓储里面存在该key,则覆盖该key对应的值

Set ( string key, string value ) : void

设置配置信息 往配置仓储添加配置,如果仓储里面存在改key,则覆盖该key对应的值

Private Methods

Méthode Description
Setting ( ) : System

静态构造方法

Method Details

GetBoolean() public static méthode

获取bool型类型配置信息值
public static GetBoolean ( string key, bool def = default(bool) ) : bool
key string key
def bool 默认值
Résultat bool

GetByte() public static méthode

获取byte类型的配置信息
public static GetByte ( string key, byte def = default(byte) ) : byte
key string key
def byte 默认值
Résultat byte

GetChar() public static méthode

获取char类型配置信息值
public static GetChar ( string key, char def = default(char) ) : char
key string key
def char 默认值
Résultat char

GetDateTime() public static méthode

获取DataTime类型配置信息值
public static GetDateTime ( string key, System.DateTime def = default(DateTime) ) : System.DateTime
key string key
def System.DateTime 默认值
Résultat System.DateTime

GetDecimal() public static méthode

获取decimal类型的配置信息
public static GetDecimal ( string key, decimal def = default(decimal) ) : decimal
key string key
def decimal 默认值
Résultat decimal

GetDouble() public static méthode

获取double类型的配置信息
public static GetDouble ( string key, double def = default(double) ) : double
key string key
def double 默认值
Résultat double

GetFloat() public static méthode

获取float类型的配置信息
public static GetFloat ( string key, float def = default(float) ) : float
key string key
def float 默认值
Résultat float

GetGuid() public static méthode

获取Guid类型配置信息值
public static GetGuid ( string key, System.Guid def = default(Guid) ) : System.Guid
key string key
def System.Guid 默认值
Résultat System.Guid

GetInt() public static méthode

获取int类型的配置信息值
public static GetInt ( string key, int def = default(int) ) : int
key string key
def int 默认值
Résultat int

GetLong() public static méthode

获取long类型的配置信息值
public static GetLong ( string key, long def = default(long) ) : long
key string key
def long 默认值
Résultat long

GetShort() public static méthode

获取short类型的配置信息
public static GetShort ( string key, short def = default(short) ) : short
key string key
def short 默认值
Résultat short

GetString() public static méthode

获取字符串类型设置信息
public static GetString ( string key, string def = "" ) : string
key string key
def string 默认值
Résultat string

Load() public static méthode

从文件加载配置信息
public static Load ( string path ) : void
path string 完整的文件名(路径+文件名)
Résultat void

Remove() public static méthode

移除配置仓储里面的多个配置信息
public static Remove ( ) : void
Résultat void

Remove() public static méthode

根据key移除配置仓储里面的配置信息
public static Remove ( string key ) : void
key string 要移除的key
Résultat void

Save() public static méthode

将配置信息保存到文件
public static Save ( string path ) : void
path string 完整的文件名(路径+文件名)
Résultat void

Set() public static méthode

设置配置信息. 往配置仓储添加配置,如果仓储里面存在该key,则覆盖该key对应的值
public static Set ( string>.IDictionary data ) : void
data string>.IDictionary 要往字典里面添加配置的信息集合
Résultat void

Set() public static méthode

设置配置信息 往配置仓储添加配置,如果仓储里面存在改key,则覆盖该key对应的值
public static Set ( string key, string value ) : void
key string
value string
Résultat void