Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have created a application in that application i need to retreive the records from event log (application Event log ) and display logs with specific event say (535) on the console how cai do this >?
Posted

C#
var result = (from EventLogEntry elog in logInfo.Entries
                  where (elog.Source.ToString().Equals("ASP.NET 2.0.50727.0"))
                  orderby elog.TimeGenerated descending
                  select elog).ToList();

May This Help
 
Share this answer
 
Like this[^]!
 
Share this answer
 
Comments
Chinna Suresh 20-Aug-14 6:06am    
I Have already wrote some custom logs i need to read the events from the event viewer
Chinna Suresh 20-Aug-14 6:08am    
http://www.c-sharpcorner.com/UploadFile/d551d3/reading-and-querying-eventviewer-efficiently-with-C-Sharp/
I have got this link but i need to display them.how can i display those events
Herman<T>.Instance 20-Aug-14 6:17am    
wat are you using. App or web?
Chinna Suresh 20-Aug-14 6:23am    
web
Herman<T>.Instance 20-Aug-14 6:28am    
If you set the events in a Collection like List<> yo can set the LIST<> as DataSource for the GridView component.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900