C#读取Windows日志
管理-->事件查看器

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
static void Main(string[] args){ EventLog eventlog = new EventLog(); eventlog.Log = "Security"; //"Application"应用程序, "Security"安全, "System"系统 EventLogEntryCollection eventLogEntryCollection = eventlog.Entries; foreach (EventLogEntry entry in eventLogEntryCollection) { //if (entry.EventID == 4624) //{ // continue; //} string info = string.Empty; if (@"TaskScheduler" == entry.Source.ToString()) { info += "类型:" + entry.EntryType.ToString() + ";"; info += "日期" + entry.TimeGenerated.ToLongDateString() + ";"; info += "时间" + entry.TimeGenerated.ToLongTimeString() + ";"; info += "来源" + entry.Source.ToString() + ";"; Console.WriteLine(info); } }} |
C#读取Windows日志的更多相关文章
- windows日志查看-非法关机判断方法
日志文件,它记录着Windows系统及其各种服务运行的每个细节,对增强Windows的稳定和安全性,起着非常重要的作用.但许多用户不注意对它保护,一些“不速之客”很轻易就将日志文件清空,给系统带来严重 ...
- Windows组件:打开MSDTC,恢复Windows TaskBar,查看windows日志,打开Remote Desktop,打开Services,资源监控
一,Win10 打开 MSDTC 1,Win+R 打开运行窗口,输入 dcomcnfg,打开组件服务窗口 2,在组件服务 catalog下找到 Distributed Transaction Coor ...
- PowerShell读取Windows产品密钥
之前大多数人可能用过VBS读取Windows产品密钥的VBS脚本,VBS脚本通常都比较隐晦.难懂,今天忙里偷闲,随手写了一个用于读取Windows产品密钥的PowerShell脚本. 代码如下: == ...
- 查看Windows日志
之前,在Windows服务管理器中启动WCF服务时,出现“本地计算机上的XXX服务启动后停止.某些服务在未由其它服务或程序使用时将自动停止.”问题,最后通过查看Windows日志中的详细信息才得以解决 ...
- Windows:打开MSDTC,恢复Windows任务栏,查看windows日志,打开远程桌面,打开Services,资源监控
Windows 服务器系列: Windows:查看IP地址,IP地址对应的机器名,占用的端口,以及占用该端口的应用程 Windows:使用Dos命令管理服务(Services) Windows:任务调 ...
- java web 中 读取windows图标并显示
java web中读取windows对应文件名的 系统图标 ....显示 1.获取系统图标工具类 package utils; import java.awt.Graphics; import j ...
- log parser分析windows日志
首先将windows安全日志导出,步骤如下: 运行eventvwr.msc命令,打开windows日志,如下图,将所有事件另存为: 保存完之后是一个.evtx格式的文件,将使用log parser分析 ...
- python 读取 log日志的编码问题
1.我要读取log日志的”执行成功”的个数,log日志编码格式为GBK 2.显示报错,大致意思是说utf-8的代码不能解析log日志 3.后来想想把log日志用GBK编码读出来,写到新文件中,用utf ...
- c#.NET中日志信息写入Windows日志中解决方案
1. 目的应用系统的开发和维护离不开日志系统,选择一个功能强大的日志系统解决方案是应用系统开发过程中很重要的一部分.在.net环境下的日志系统解决方案有许多种,log4net是其中的佼佼者.在Wind ...
随机推荐
- C基础 内存统一入口
引言 - malloc 引述 C标准中堆上内存入口就只有 malloc, calloc, realloc . 内存回收口是 free. 常见的一种写法是 struct person * per = ...
- python内建方法
abs all any apply basestring bin bool buffer bytearray bytes callable chr classmethod cmp coerce com ...
- JSP(3) - 9个JSP内置对象 - 小易Java笔记
1.9个JSP内置对象 内置对象引用名称 对应的类型 request HttpServletRequest response HttpServletResponse config Servle ...
- 流程控制--while
/* while 是在有条件控制的情况下 进行的循环 */ [root@localhost test1]# vim .py //ADD #!/usr/bin/python n = while True ...
- html5重力感应事件之DeviceMotionEvent
前言 今天主要介绍一下html5重力感应事件之DeviceMotionEvent,之前我的一篇文章http://www.haorooms.com/post/jquery_jGestures, 介绍了第 ...
- Nginx惊群处理
惊群:是指在多线程/多进程中,当有一个客户端发生链接请求时,多线程/多进程都被唤醒,然后只仅仅有一个进程/线程处理成功,其他进程/线程还是回到睡眠状态,这种现象就是惊群. 惊群是经常发生现在serve ...
- js刷新页面代码
第一种: location.reload() 第二种: location.replace(location.href) 第三种: history.go() 第四种: location=location ...
- AC日记——「SCOI2015」国旗计划 LiBreOJ 2007
#2007. 「SCOI2015」国旗计划 思路: 跪烂Claris 代码: #include <cstdio> #include <algorithm> #define ma ...
- The 18th Zhejiang University Programming Contest Sponsored by TuSimple -C Mergeable Stack
题目链接 题意: 题意简单,就是一个简单的数据结构,对栈的模拟操作,可用链表实现,也可以用C++的模板类来实现,但是要注意不能用cin cout,卡时间!!! 代码: #include <std ...
- gvim 编辑器配置
"关才兼容模式 set nocompatible "模仿快捷键,如:ctrt+A 全选.Ctrl+C复制. Ctrl+V 粘贴等 source $VIMRUNTIME/vimrc_ ...