Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top