Message Log Component in C#

五迷三道 提交于 2019-12-08 04:02:31

问题


What I want to have is a box that displays a list of messages in chronological order (most recent at the bottom) like is common in FTP apps and IDEs. Here's the FileZilla message log:

Example of message log in FileZilla http://img571.imageshack.us/img571/9247/messageloginfilezilla.png

At the moment, I'm getting similar functionality from a read only text box, but this isn't perfect.

Bonus points for the following:

  1. Context menu has the option of "copy this message"
  2. Filtering by "level"
  3. Option to write log to file

回答1:


You could log into Event Log. It has quite usable interface. You can also use Enterprise Library if you plan to switch to database, file or other logging destination which enterprise library supports




回答2:


Here is one in WPF made for log4net: C# WPF Log4Net Viewer

Edit:
Log2Console is an utility(winforms) based on ListView control for handling logs during development: Log2Console - A Generic Log Viewer (for Log4Net, NLog...)



来源:https://stackoverflow.com/questions/3101594/message-log-component-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!