• 写在windows中的日志类


     public class LogWriter
        {
            /// <summary>
            /// 写入系统日志
            /// </summary>
            /// <param name="message">事件内容</param>
            private static void LogEvent(EventLogEntryType eventLogType, string eventSourceName, string message)
            {
                if (!EventLog.SourceExists(eventSourceName))
                {
                    EventLog.CreateEventSource(eventSourceName, "Application");
                }
                EventLog.WriteEntry(eventSourceName, message, eventLogType);
            }
            public static void LogErrorEvent(string eventSourceName, string message)
            {
                LogEvent(EventLogEntryType.Error, eventSourceName, message);
            }
            public static void LogWaringEvent(string eventSourceName, string message)
            {
                LogEvent(EventLogEntryType.Warning, eventSourceName, message);
            }
        }

  • 相关阅读:
    scrapy框架(一)
    selenium爬取京东商品信息
    自动化测试工具selenium的使用
    xpath选择器的使用
    爬取网页数据实例
    爬虫实操
    爬虫之`beautifulsoup4`模块
    DNS学习笔记
    MongoDB集群部署
    MongoDB单机部署
  • 原文地址:https://www.cnblogs.com/zhangsongshan/p/3056154.html
Copyright © 2020-2023  润新知