惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
J
Java Code Geeks
Martin Fowler
Martin Fowler
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
博客园 - 【当耐特】
Y
Y Combinator Blog
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
罗磊的独立博客
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
博客园 - 司徒正美

博客园 - N/A2011

Managing Hierarchical Data in MySQL php soapclient with wsse 转贴 MySQL Multiple Result Procs in PHP 转贴 jQuery Datepicker by Example 转贴 Using MySQL Stored Procedures with PHP mysql/mysqli/pdo php generate pdf open office (java) ant + emma + junit Copy all files recursively from one folder to another RecursiveFileFinder 转贴: 怎样找第一份工作 PerformanceCounter in .net Trace in .net 转贴: 傅立叶级数(Fourier Series) 推导 CAS in .net Encrypting and Decrypting in .net Access Control List in .net User and Data Security in .net Unmanaged code in .net
Logger in .net
N/A2011 · 2009-06-16 · via 博客园 - N/A2011

C#:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;namespace LoggerCS
{
    
class Program
    {
        
static void Main(string[] args)
        {
            
if (!EventLog.Exists("Application""Dragon-PC"))
            {
                EventSourceCreationData esc 
= new EventSourceCreationData("JoeyDemo""Application");
                esc.MachineName 
= "Dragon-PC";
                EventLog.CreateEventSource(esc);
            }
            EventLog el 
= new EventLog("Application""Dragon-PC""JoeyDemo");
            el.WriteEntry(
"Event Written to Application Log", EventLogEntryType.Information, 234, Convert.ToInt16(3));
        }
    }
}

VB.NET:

Imports System.DiagnosticsModule Module1Sub Main()
        
If Not EventLog.Exists("Application""Dragon-PC"Then
            
Dim esc As EventSourceCreationData = New EventSourceCreationData("JoeyDemo""Application")
            esc.MachineName 
= "Dragon-PC"
            EventLog.CreateEventSource(esc)
        
End If
        
Dim el As EventLog = New EventLog("Application""Dragon-PC""JoeyDemo")
        el.WriteEntry(
"Event Written To Application Log", EventLogEntryType.Information, 234CType(3Short))
    
End SubEnd Module