コード例 #1
0
        public ExceptionReportGenerator(ExceptionReportInfo reportInfo)
        {
            if (reportInfo == null)
            {
                throw new ExceptionReportGeneratorException("reportInfo cannot be null");
            }

            _reportInfo = reportInfo;

            _reportInfo.ExceptionDate = DateTime.UtcNow;
            _reportInfo.UserName      = Environment.UserName;
            _reportInfo.MachineName   = Environment.MachineName;
            _reportInfo.RegionInfo    = Thread.CurrentThread.CurrentCulture.EnglishName;
            _reportInfo.AppName       = string.IsNullOrEmpty(_reportInfo.AppName) ? System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString() : _reportInfo.AppName;
            _reportInfo.AppVersion    = string.IsNullOrEmpty(_reportInfo.AppVersion) ? System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() : _reportInfo.AppVersion;
            System.Net.WebClient client = new WebClient();
            try
            {
                _reportInfo.IP = client.DownloadString("http://myip.dnsomatic.com/");
            }
            catch
            {
                _reportInfo.IP = "";
            }
        }
コード例 #2
0
 public ConfigReader(ExceptionReportInfo reportInfo)
 {
     _info = reportInfo;
 }
コード例 #3
0
 public EmailBuilder(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }
コード例 #4
0
 public EmailBuilder(ExceptionReportInfo reportInfo, IEnumerable <SysInfoResult> sysInfoResults)
     : this(reportInfo)
 {
     _sysInfoResults = sysInfoResults;
 }
コード例 #5
0
 internal MailSender(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }