Trace in .net
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace TraceCS
{
class Program
{
static void Main(string[] args)
{
Trace.Listeners.Clear();
EventLog ev = new EventLog("JoeyLog", "Dragon-PC", "Demo");
EventLogTraceListener eltl = new EventLogTraceListener(ev);
Trace.WriteLine("This is a test");
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace TraceCS
{
class Program
{
static void Main(string[] args)
{
Trace.Listeners.Clear();
EventLog ev = new EventLog("JoeyLog", "Dragon-PC", "Demo");
EventLogTraceListener eltl = new EventLogTraceListener(ev);
Trace.WriteLine("This is a test");
}
}
}
VB.NET:
Imports System.Diagnostics
Module Module1
Sub Main()
Trace.Listeners.Clear()
Dim ev As EventLog = New EventLog("JoeyLog", "Dragon-PC", "Demo")
Dim eltl As EventLogTraceListener = New EventLogTraceListener(ev)
Trace.WriteLine("This is a test")
End Sub
End Module
Module Module1
Sub Main()
Trace.Listeners.Clear()
Dim ev As EventLog = New EventLog("JoeyLog", "Dragon-PC", "Demo")
Dim eltl As EventLogTraceListener = New EventLogTraceListener(ev)
Trace.WriteLine("This is a test")
End Sub
End Module