1.Reading and Writing Events to/from EventLog Example
2.How to Read Events Example
3.How to Log Events Example
4.How to Register an Event Source Example
5.How to view Event Logs Example
Free Online Training VIDEOS,SAMPLES,TUTORIALS ON MCTS EXAM C#.NET(MS VISUAL STUDIO) Thanks for your support. The blog is getting bigger and better day by day. please check out : www.blog.sameershaik.com for further interesting articles on other microsoft certification examinations
Search this blog
You can search for all the topics in our blog using our google custom search now.
Search the blog
Loading
Showing posts with label Topic Logging and Systems Management. Show all posts
Showing posts with label Topic Logging and Systems Management. Show all posts
Wednesday, January 5, 2011
Wednesday, September 8, 2010
Reading and Writing Events to/from EventLog
In this post we will explore the following topics:
1. How to view Event Logs?To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-view-event-logs.html)
2. How to Register an Event Source?To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-register-event-source.html)
3. How to Log Events? To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-log-events.html)
4. How to Read Events?(http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-read-events.html)
The following is the sample code for the above topics:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
if (!EventLog.Exists("My Log"))
{
EventLog.CreateEventSource("Sam Application", "My Log");
}
EventLog mylog = new EventLog("My Log");
mylog.Source = "Sam Application";
mylog.WriteEntry("Could not connect", EventLogEntryType.Error, 1001, 1);
Console.WriteLine("Event log written now trying to read from event log");
Console.ReadKey();
Console.Clear();
foreach (EventLogEntry entry in mylog.Entries)
Console.WriteLine(entry.Message);
Console.WriteLine("Press any key to exit!!!");
Console.ReadKey();
}
}
}
We will see in detail all the three topics in the coming video tutorials which will be posted soon.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
1. How to view Event Logs?To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-view-event-logs.html)
2. How to Register an Event Source?To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-register-event-source.html)
3. How to Log Events? To View Click Here (http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-log-events.html)
4. How to Read Events?(http://mctsexam70-536tutorials.blogspot.com/2010/09/how-to-read-events.html)
The following is the sample code for the above topics:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
if (!EventLog.Exists("My Log"))
{
EventLog.CreateEventSource("Sam Application", "My Log");
}
EventLog mylog = new EventLog("My Log");
mylog.Source = "Sam Application";
mylog.WriteEntry("Could not connect", EventLogEntryType.Error, 1001, 1);
Console.WriteLine("Event log written now trying to read from event log");
Console.ReadKey();
Console.Clear();
foreach (EventLogEntry entry in mylog.Entries)
Console.WriteLine(entry.Message);
Console.WriteLine("Press any key to exit!!!");
Console.ReadKey();
}
}
}
We will see in detail all the three topics in the coming video tutorials which will be posted soon.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
How to Read Events?
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
How to Log Events?
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
How to Register an Event Source?
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
How to view Event Logs?
Hi,
In the video tutorial i have shown how to view an event log of an application which we created and installed onto our system.Only once the our application is installed onto our system, we can create an event log for our application.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
In the video tutorial i have shown how to view an event log of an application which we created and installed onto our system.Only once the our application is installed onto our system, we can create an event log for our application.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
Subscribe to:
Posts (Atom)