Esempio n. 1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="message"></param>
 /// <param name="ex"></param>
 /// <param name="_method"></param>
 /// <param name="_rank"></param>
 /// <param name="_extype"></param>
 public ExceptionXml(string message, Exception ex, string _method, ExRank _rank, ExceptionType _extype)
     : base(message, ex)
 {
     Rank   = _rank;
     ExType = _extype;
     Method = _method;
 }
Esempio n. 2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="message"></param>
 /// <param name="ex"></param>
 /// <param name="_method"></param>
 /// <param name="_rank"></param>
 public ExceptionMe(string message, Exception ex, string _method, ExRank _rank)
     : base(message, ex)
 {
     Rank   = _rank;
     Method = _method;
 }
Esempio n. 3
0
        /// <summary>
        /// 自定义异常写入 Defineds the exception write log.
        /// </summary>
        /// <param name="message">String</param>
        /// <param name="innertext">String</param>
        /// <param name="source">String</param>
        /// <param name="rank">ExRank</param>
        /// <param name="extype">ExceptionType</param>
        /// date:2009-11-20
        /// time:10:41
        /// author:ZKZX-XA025
        /// ----------------------------------------------------------------------------------------
        private static void DefinedExceptionWriteLog(string message, string innertext, string source, ExRank rank, ExceptionType extype, string UrlPathAndLine)
        {
            string strrank = null;

            switch (rank)
            {
            case ExRank.Serious:
                strrank = "严重";
                break;

            case ExRank.Emergency:
                strrank = "紧急";
                break;

            case ExRank.General:
                strrank = "一般";
                break;

            case ExRank.Warning:
                strrank = "提示";
                break;

            default:
                strrank = "提示警告";
                break;
            }

            string strextype = null;

            switch (extype)
            {
            case ExceptionType.System:
                strextype = "系统异常";
                break;

            case ExceptionType.Register:
                strextype = "注册表异常";
                break;

            case ExceptionType.IO:
                strextype = "文件操作异常";
                break;

            case ExceptionType.None:
                strextype = "未知异常";
                break;

            default:
                strextype = "系统异常";
                break;
            }
            WriteFile("[" + DateTime.Now.ToString() + "]" + message + "     " + source + "     " + innertext + "[" + UrlPathAndLine + "]" + "     " + strrank + "     " + strextype);
        }