记录事件
2015-07-16 11:15
302 查看
class Program
{
static string EventSource = "WriteToHydee";
static string logName = "WriteToHydeeExceptinLog";
static void Main(string[] args)
{
if (!EventLog.SourceExists(EventSource))
{
var eventSource = new EventSourceCreationData(EventSource, logName);
EventLog.CreateEventSource(eventSource);
}
EventLog log = new EventLog(logName,".",EventSource);
log.WriteEntry("服务启动",EventLogEntryType.Information);
log.Close();
//Method.SynchIndent();
}
}
运行程序是以 管理员身份安装和运行。
{
static string EventSource = "WriteToHydee";
static string logName = "WriteToHydeeExceptinLog";
static void Main(string[] args)
{
if (!EventLog.SourceExists(EventSource))
{
var eventSource = new EventSourceCreationData(EventSource, logName);
EventLog.CreateEventSource(eventSource);
}
EventLog log = new EventLog(logName,".",EventSource);
log.WriteEntry("服务启动",EventLogEntryType.Information);
log.Close();
//Method.SynchIndent();
}
}
运行程序是以 管理员身份安装和运行。
相关文章推荐
- 全新Win10通用版网页商店正式上线 应用超60万 附访问地址
- 滚动监听 滚屏与菜单联动
- solr安装ansj_seg分词
- In android studio,cannot load 2 facets-unknown facet type:android and android-gradle
- java 删除文件(删除空目录)
- HDU-5108
- IE 下button 超链接失效的解决办法
- JS生成UUID
- java.lang.NoClassDefFoundError: com.android.volley.toolbox.Volley
- 推箱子小游戏v1.5
- cocos2dx 常见的49中动作详解
- 深度优先搜索算法
- Leetcode 238 Product of Array Except Self 时间O(n)和空间O(1)解法
- Canny边缘查找的实现
- /proc/interrupts 和 /proc/stat 查看中断的情况 (转载)
- Java中使用BASE64加密&解密
- 腾讯企业邮箱外域邮件发送失败原因及其解决方案
- jQuery傳送json給php接收, php再傳送json回jQuery
- 什么是MIME类型
- Android 操作系统的内存回收机制