به نام خدا سلام بر برنامه نویسان عزیز 😉 در این پست کد ساخت event source و نوشتن event درون event log در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد ساخت event source و نوشتن event درون event log در سی شارپ #C :
using System;
using System.Diagnostics;
class MainClass
{
public static void Main ()
{
if (!EventLog.SourceExists("MyEventSource"))
{
EventLog.CreateEventSource("MyEventSource", "Application");
}
using System.Diagnostics;
class MainClass
{
public static void Main ()
{
if (!EventLog.SourceExists("MyEventSource"))
{
EventLog.CreateEventSource("MyEventSource", "Application");
}