如何使用C#读取应用程序日志? [英] How Do I Read Application Log Using C#?
本文介绍了如何使用C#读取应用程序日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在该应用程序中创建了一个应用程序,我需要从事件日志(应用程序事件日志)中检索记录,并在控制台上显示具有特定事件的日志(535),如何执行此操作>?
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 >?
推荐答案
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
喜欢这个 [ ^ ]!
这篇关于如何使用C#读取应用程序日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文