using System;
using System.Diagnostics; namespace WriteToAnEventLog_csharp
{
/// Summary description for Class1.
class Class1
{
static void Main(string[] args)
{
string sSource;
string sLog;
string sEvent; sSource = "dotNET Sample App";
sLog = "Application";
sEvent = "Sample Event"; if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource,sLog); EventLog.WriteEntry(sSource,sEvent);
EventLog.WriteEntry(sSource, sEvent,
EventLogEntryType.Warning, 234);
}
}
}

How to write to an event log by using Visual C#的更多相关文章

  1. ora-28056 (Writing audit records to Windows Event Log failed)

    系统:windows xp oracle 版本 SQL> select * from v$version; BANNER ------------------------------------ ...

  2. windows 系统无法启动windows event log 服务

    windows 系统无法启动windows event log 服务 关键词:无法启动系统事件日志 尝试解决步骤 [1]权限:把如图中logsfile文件等都给local service [2]把C: ...

  3. application pool can not write to event log

    https://stackoverflow.com/questions/9564420/the-source-was-not-found-but-some-or-all-event-logs-coul ...

  4. Event log c++ sample.

    1. Init regedit. bool InitLog( TCHAR *logName, TCHAR *sourceName, TCHAR *MessageDllName ) { // This ...

  5. AngularJS - $index, $event, $log

    原文: https://thinkster.io/egghead/index-event-log --------------------------------------------------- ...

  6. AWR发现TOP Event log file sequential read

    对客户DB进行巡检,发现TOP EVENT是LOG FILE Sequential read 等待事件说明 https://www.xuebuyuan.com/zh-hant/1743045.html ...

  7. KMS Event LOG

    The 12290 event entry gives a significant amount of information that can be used to figure out what ...

  8. 如何在 Windows Event Log 中查找系统重启的信息

    事件ID:12 事件ID 13: 事件ID 41: 事件ID 6008: 事件ID 1074:事件ID 1074: ========================================== ...

  9. Android 解读Event和Main Log

    1 Android P EventLogTags文件 Android P 9.0.0 所有EventLogTags文件List: system/bt/EventLogTags.logtags syst ...

随机推荐

  1. 一致性Hash算法的原理与实现(分布式映射算法)

    一致性Hash算法解决的问题: 解决分布式系统中的负载均衡问题 背景问题:有N台服务器提供缓存服务,需要对服务器进行负载均衡,将请求平均发到每台服务器上,每台服务器负载1/N的服务 硬Hash映射:将 ...

  2. 关于GitHub的Hello Word

    最近GitHub一直是最火的配置库技术之一,各个技术大牛也都纷纷入驻GitHub 我每天都打交道的DITA-OT开源项目也宣布迁入GitHub. 那么GitHub到底有什么过人之处呢?给各位先扫个盲. ...

  3. jenkins自动部署应用到tomcat中,编译后shell脚本的简单示例

    jenkins的安装这里就不做描述了,很简单的  百度搜索一下即可 这里安装的jenkins-2.39-1.1 wget http://pkg.jenkins-ci.org/redhat/jenkin ...

  4. 微信小程序支付异常:requestPayment:fail no permission

    今天在调试微信小程序支付时碰到了这个问题,支付参数都正常生成了,在调用 wx.requestPayment 进行支付时遇到了这个报错,查了一下发现是开发者工具中 AppID 写错了,用的 AppID ...

  5. java连接Mysql8

    相较于之前版本会有部分改动 pom依赖 <dependency> <groupId>mysql</groupId> <artifactId>mysql- ...

  6. 微信小程序web-view页面安卓下显示空白的解决办法!!!

    web-view页面在你向地址拼接参数展示页面时,在安卓上有时会显示空白 解决方案: A: 普通不需要参数的话可以直接把地址写在src里,不要去在onLoad里获取你的全局变量后再赋值. B: 如果需 ...

  7. linux上搭建svn服务器

    1.检查当前版本,没有的话用yum安装rpm -qa subversion 2.安装yum install subversion -y 2.建库mkdir -p /home/svn/projectsv ...

  8. Python-爬虫的基本原理

    什么是爬虫 爬虫就是请求网站并提取数据的自动化程序.其中请求,提取,自动化是爬虫的关键!下面我们分析爬虫的基本流程 爬虫的基本流程 发起请求通过HTTP库向目标站点发起请求,也就是发送一个Reques ...

  9. H5 类选择器

    10-类选择器 错误的写法: --> 迟到毁一生 早退穷三代 按时上下班 必成高富帅 我是段落 我是段落 <!DOCTYPE html> <html lang="en ...

  10. Alpha冲刺阶段评分发布

    一班 二班 三班  四班