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. upper_bound

    头文件: #include<algorithm> 作用: 查找第一个大于给定数的元素或位置 在从小到大的排序数组中, 1.容器 (1).返回元素 #include<cstdio> ...

  2. js 捕捉滚动条事件

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  3. Python实现分发数据块到多台服务器上

    代码如下: # coding: utf-8 import paramiko import re import os from time import sleep # 定义一个类,表示一台远端linux ...

  4. IT面试技巧终身受益

    面试前的准备 首先我们要穿的得体,因为第一印象对一个面试官来说真的很重要,如果我们面试的时候都不能以一种非常认真的态度去对待,那么可想而知其实我们离面试成功的路渐行渐远,当然这只是说第一印象,并不能代 ...

  5. Python实现将爱词霸每日一句定时推送至微信

    前言 前几天在网上看到一篇文章<教你用微信每天给女票说晚安>,感觉很神奇的样子,随后研究了一下,构思的确是巧妙.好,那就开始动工吧!服务器有了,Python环境有了,IDE打开了...然而 ...

  6. Jmeter(三十八)while控制器实现ssh三次重连

    在jmeter中,可以使用SSH协议连接主机进行相关操作, 步骤如下 首先添加一个ssh command  我们的测试交流群:317765580 在command中填写远程连接的必要信息 结果树中可以 ...

  7. Jmeter(三十六)_运行过程中改变负载

    顾名思义,jmeter在做性能测试时,可以在不停止脚本的情况下修改负载压力,达到期望的测试效果.我们将通过Constant Throughput Timer(吞吐量计时器)和Beanshell服务器来 ...

  8. Streaming Principal Component Analysis in Noisy Settings

    论文背景: 面对来袭的数据,连续样本不一定是不相关的,甚至不是同分布的. 当前,大部分在线PCA都只关注准确性,而忽视时效性! 噪声?数据缺失,观测有偏,重大异常? 论文内容: Section 2 O ...

  9. Floyd最短路(带路径输出)

    摘要(以下内容来自百度) Floyd算法又称为插点法,是一种利用动态规划的思想寻找给定的加权图中多源点之间最短路径的算法,与Dijkstra算法类似. 该算法名称以创始人之一.1978年图灵奖获得者. ...

  10. hibernate添加数据时Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: com.javakc.hibernate.test.entity.TestEntity.testName

    意思是,一个非null属性引用了一个null或瞬态值.就是在对应实体类配置文件hbm.xml中该属性配置了not-null="true",将其去掉即可.