.NET : How to set user information in an EventLog Entry?

后端 未结 3 1862
孤独总比滥情好
孤独总比滥情好 2020-12-11 20:33

The System.Diagnostics.EventLog class provides a way to interact with a windows event log. I use it all the time for simple logging...

System.Diagnostics.Ev         


        
3条回答
  •  萌比男神i
    2020-12-11 21:07

    You need to add it yourself into the event message.

    Use the System.Security.Principal namespace to get the current identity of the thread logging the event.

提交回复
热议问题