设置是否发送errorlogs(true发送,false不发送)
来源:互联网 发布:linux怎么做脚本 编辑:程序博客网 时间:2024/06/06 07:24
using System;
using System.Web;
using System.Xml;
using System.Web.Caching;
namespace Baolee.GeneralMethod
{
/// <summary>
/// ProgSetting 的摘要说明。
/// </summary>
public class ProgSetting
{
/// <summary>
/// 构造函数
/// </summary>
public ProgSetting()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 是否调试,即 Message.SendDebug 方法是否输出记录
/// </summary>
public static bool IsDebug
{
get
{
Cache cache = HttpContext.Current.Cache;
if (cache["IsDebug"] == null)
{
cache.Insert("IsDebug", GetNode("//AppSetting/Debug"), new CacheDependency(SettingFilePath));
}
try
{
return CheckData.ToBool(cache["IsDebug"]);
}
catch
{
return false;
}
}
}
/// <summary>
///
/// </summary>
private static string SettingFilePath
{
get
{
return (PublicConst.RootPath + "AppSetting.xml");
}
}
/// <summary>
///
/// </summary>
/// <param name="xPath"></param>
/// <returns></returns>
private static string GetNode(string xPath)
{
XmlDocument document = new XmlDocument();
try
{
document.Load(SettingFilePath);
return document.DocumentElement.SelectSingleNode(xPath).InnerText;
}
catch
{
return "";
}
}
AppSetting.xml
<?xml version="1.0" encoding="GB2312" standalone="yes"?>
<AppSetting>
<Debug>True</Debug>
</AppSetting>
}
}
- 设置是否发送errorlogs(true发送,false不发送)
- 发送错误报告errorlogs的函数
- 设置TCP不缓存直接发送
- 发送短信及其判断是否发送成功
- IDOC发送不出去
- zabbix不发送邮件
- select 设置发送超时发送注意事项
- select 设置发送超时发送注意事项
- 让jsp引擎不检测jsp页面是否发送修改
- 设置发送超时
- 设置邮件发送
- mediawiki发送邮件设置
- DESTOON邮件发送设置
- 设置UDP发送端口
- 设置发送超长短信
- nrf51822 --- 设置发送功率
- wordpress发送邮件设置
- CC2530发送功率设置
- 操作图片类(C#)
- 发送email类[2](C#)
- Message类,常用方法类(C#)
- 13,06,2007 rainy
- Exception异常类(C#)
- 设置是否发送errorlogs(true发送,false不发送)
- PublicConst常用日期类(C#)
- RedirectPage改写response.redir类(C#)
- 发送email类[3](C#)
- UBB类(C#)
- WriteXml类(C#)
- pidgin登录QQ提示密码错误的解决办法
- 寻找我的linux学习方向
- 汇编指令