使用反射获取类的静态属性值
public class GetConn
{
/// <summary>
/// 数据库连接字符串
/// </summary>
public static string connString
{
get
{
return ConfigurationManager.AppSettings["connString"];
}
}
public static string CrmConnString
{
get
{
return ConfigurationManager.AppSettings["CrmConnString"];
}
}
public static string QhdConnString
{
get
{
return ConfigurationManager.AppSettings["QhdConnString"];
}
}
public static string BjConnString
{
get
{
return ConfigurationManager.AppSettings["BjConnString"];
}
}
public static string ZzConnString
{
get
{
return ConfigurationManager.AppSettings["ZzConnString"];
}
}
}
方法:
补充:软件开发 , C# ,