문제

I want to display certain events from the event log on a web page. For this I have to use a MVC4 application in .NET framework version 4. I've read about SignalR and push messages, but I can't find any clear information on how to implement this. Perhaps I am searching for the wrong things.

Can anybody point me to a tutorial on this subject or explain how I can realize a part on a webpage where about the 5 latest relevant events (based on category) are displayed?

도움이 되었습니까?

해결책

Assuming you don't want to update your page in real-time then you can use something like

var eventLog = new EventLog("logName", "machine", "source");
foreach(var entry in eventLog.Entries)
{
}

to read the event log data and then pass it to your view model.

You would only need SignalR if you wanted to push updates to your your page.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top