zoukankan      html  css  js  c++  java
  • C# create Windows event logs by EventLog.

    1. What's Windows event logs.

    A: MSDN event logs http://support.microsoft.com/kb/308427

      

    • Application log

      The application log contains events logged by programs. For example, a database program may record a file error in the application log. Events that are written to the application log are determined by the developers of the software program.
    • Security log

      The security log records events such as valid and invalid logon attempts, as well as events related to resource use, such as the creating, opening, or deleting of files. For example, when logon auditing is enabled, an event is recorded in the security log each time a user attempts to log on to the computer. You must be logged on as Administrator or as a member of the Administrators group in order to turn on, use, and specify which events are recorded in the security log.
    • System log

      The system log contains events logged by Windows XP system components. For example, if a driver fails to load during startup, an event is recorded in the system log. Windows XP predetermines the events that are logged by system components.

    2.  We create an user-defined Log.

      

    using  System.Diagnostics
    EventLog.WriteEntry(
    "A1", uninstallCmd);


     3. Now we can see the log file in windows.

     

  • 相关阅读:
    linux中nc命令
    Centos6.5 安装zabbix3(收藏,非原创)
    紀念
    算法学习资源收集
    一道奇怪的求和题
    P5717 题解
    P1424 刷题记录
    P1888 题解
    P1422 刷题记录
    P1055 题解
  • 原文地址:https://www.cnblogs.com/zencorn/p/1887618.html
Copyright © 2011-2022 走看看