Windows event viewer Part 72











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=cKy6rlXOQ5M

Text version of the video • http://csharp-video-tutorials.blogspo... • Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. •    / @aarvikitchen5572   • Slides • http://csharp-video-tutorials.blogspo... • All ASP .NET Text Articles • http://csharp-video-tutorials.blogspo... • All ASP .NET Slides • http://csharp-video-tutorials.blogspo... • All Dot Net and SQL Server Tutorials in English • https://www.youtube.com/user/kudvenka... • All Dot Net and SQL Server Tutorials in Arabic •    / kudvenkatarabic   • Exceptions in an asp.net web application can be logged to the event viewer. First let us discuss about the event viewer and create custom event log and event source. To access the event viewer • 1. Click on Start • 2. Type Run and press enter • 3. In the Run window typpe eventvwr and press enter • 4. This should open up event viewer • Under windows logs, you should see • 1. Application - Logs information from applications like MS Office, SQL Server, Visual Studio etc. • 2. Security - Logs information related to security like user sign-ons, access checks etc • 3. System - Logs information related to driver, system service failures etc. • Let us now create a windows application that can be used to create a custom windows event log and event source. The Event Source is the name of the application that logged the event. The event source is displayed in the details pane, when an event is selected in the event viewer. • Steps to create the windows application to create the custom windows event log and event source. • 1. Drag and drop two textboxes, two labels, and a button control on to the windows form • 2. Arrange the controls, so the form looks as shown below. • //Custom Event Logs in event viewer • 3. Double click the button control to generate the event handler • 4. Copy and paste the following code in the click event handler • private void CreateEventLogButton_Click(object sender, EventArgs e) • { • if (EventLogNameTextBox.Text != string.Empty EventLogSourceTextBox.Text != string.Empty) • { • System.Diagnostics.EventLog.CreateEventSource • (EventLogSourceTextBox.Text, EventLogNameTextBox.Text); • MessageBox.Show( Event Log and Source Created ); • } • else • { • MessageBox.Show( Event Log and Source are required ); • } • } • 5. Run the application • 6. Enter the name and source for the event log. • 7. Click Create Event Log and Event Source Button button • Open the event viewer. The newly created event log should be under Applications and Service Logs. If you are not able to locate them, restart your machine. • To delete the custom event log, use the Delete() method • System.Diagnostics.EventLog.Delete( EventLogNameToDelete )

#############################









Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org