得到AppSettings中的配置信息的自定义类
来源:互联网 发布:超级基因优化液全集txt 编辑:程序博客网 时间:2024/06/09 20:14
using System;
using System.Configuration;
namespace OpenHack4
{
/// <summary>
/// web.config操作类
/// </summary>
public sealed class ConfigHelper
{
/// <summary>
/// 得到AppSettings中的配置字符串信息
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string GetConfig(string key)
{
return ConfigurationSettings.AppSettings[key];
}
/// <summary>
/// 得到AppSettings中的配置bool值信息
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool GetConfigBool(string key)
{
bool result = false;
string cfgVal = GetConfig(key);
if(null != cfgVal && string.Empty != cfgVal)
{
try
{
result = bool.Parse(cfgVal);
}
catch(FormatException)
{
// Ignore format exceptions.
}
}
return result;
}
}
}
- 得到AppSettings中的配置信息的自定义类
- 得到AppSettings中的配置信息的自定义类
- 得到AppSettings中的配置字符串信息
- 得到AppSettings中的配置Bool信息
- 得到AppSettings中的配置Decimal信息
- 得到AppSettings中的配置int信息
- .net 中的哪些配置问题 appSettings
- .NET Core类库项目中如何读取appsettings.json中的配置
- DotNetCore跨平台~在appsettings.json里自定义配置项
- 如何得到nutch中配置类Configuration中所有的配置信息
- 如何得到QML中的TextArea的slider的位置信息
- 得到ConnectionString中的特定信息
- CCConfiguration(配置类 可以得到当前载体的支持功能信息 )
- Java读取properties文件,得到数据库的配置信息
- 得到用户手机中的程序使用流量的信息
- java得到类信息的代码演示
- 反射得到类的内部信息
- 得到电脑的信息
- DataGrid使用技巧小总结-个性化分页及复杂表头
- Introduction to IoC
- 利用META帮助FireFox浏览器发现RSS
- url传递中文的解决方案总结--By Asp.net
- Java Corba实例
- 得到AppSettings中的配置信息的自定义类
- CSS字体的详细设定
- 得到文本框选中的文字,动态插入文字
- Web开发中常见的安全缺陷及解决办法
- VMProtect 1.1
- html 控件使用
- 世界五百强面试题目及应答评点
- 个人使用控件点滴
- DataList小结