예제 #1
0
        protected void Send(ICatchMe Entry)
        {
#if !WindowsCE
            MailMessage message = new MailMessage();
            message.From = new MailAddress(_Info.from);
            foreach (string s in _Info.to)
            {
                message.To.Add(s);
            }
            message.Subject    = _Info.subject;
            message.Body       = Entry.ToHtml();
            message.IsBodyHtml = true;

            SmtpClient client = new SmtpClient(_Info.server, 25);
            client.Credentials = _Info.Credential;
            try
            {
                client.Send(message);
            }
            catch (Exception ex)
            {
                LogTrace.CatchException.CatchMe.WriteException(ex).WriteOnly <LogFile>();
            }
#if NET45
            client.Dispose();
#endif
#else
            LogTrace.CatchException.CatchMe.WriteMessage("LogSmtp Not Working in WindowsCE").Write <LogFile>();
#endif
        }
예제 #2
0
        public void Write(ICatchMe Entry)
        {
            if (Entry.UrgenceLevel.HasValue && (Level != 0))
            {
                if (Entry.UrgenceLevel.Value > Level)
                {
                    return;
                }
            }



            throw new NotImplementedException();
        }
예제 #3
0
        public void Write(ICatchMe Entry)
        {
            if (IpAddress != null)
            {
                return;
            }

            if (Entry.UrgenceLevel.HasValue && (Level != 0))
            {
                if (Entry.UrgenceLevel.Value > Level)
                {
                    return;
                }
            }

            try
            {
#if !NET35
                if (_fs == null)
                {
                    _fs = new CatchException.Service.CatchException();
                }
                _fs.WriteInJournal(Entry.ComputerName, Entry.GetApplicationId(), true, Entry.ToHtml());
#else
#if !WindowsCE
                if (_fs == null)
                {
                    _fs = new CatchException.Service.CatchExceptionClient(new BasicHttpBinding(), new EndpointAddress(FullUrl));
                }
                _fs.WriteInJournal(Entry.ComputerName, Entry.GetApplicationId(), Entry.ToHtml());

                _fs.Close();
#else
                if (_fs == null)
                {
                    _fs = new WcfException.CatchException();
                }

                AsyncCallback cb = new AsyncCallback(OnAsyncWifiLog);
                _fs.BeginWriteInJournal(Entry.ComputerName, Entry.GetApplicationId(), true, Entry.ToHtml(), cb, null);
#endif
#endif
            }
            catch (Exception ex)
            {
                CatchMe.WriteException(ex).Where("LogWcf::Write").WriteOnly <LogFile>();
            }
        }
예제 #4
0
        public void Write(ICatchMe Entry)
        {
            if (Entry.UrgenceLevel.HasValue && (Level != 0))
            {
                if (Entry.UrgenceLevel.Value > Level)
                {
                    return;
                }
            }

            if (_Info == null)
            {
                return;
            }

            Send(Entry);
        }