异常信息 Exception
void GetExceptionMsg(Exception ex, StringBuilder sb, string Prefix = "") { sb.AppendLine(Prefix + "【异常类型】:" + ex.GetType().Name); sb.AppendLine(Prefix + "【异常信息】:" + ex.Message); sb.AppendLine(Prefix + "【堆栈调用】:" + ex.StackTrace); sb.AppendLine(Prefix + "【异常方法】:" + ex.TargetSite); if (ex.InnerException != null) GetExceptionMsg(ex.InnerException, sb, Prefix + "\t"); }
慎于行,敏于思!GGGGGG