Writing trace information in a windows form app

后端 未结 5 754
小鲜肉
小鲜肉 2021-02-11 08:39

I know how to write trace statements that I can view in a webforms environment, but how do I do this in a windows forms app?

I am inside of a static method, and I want t

5条回答
  •  后悔当初
    2021-02-11 09:10

    The System.Diagnostics.Trace class will write to trace listeners.

    The default listener writes to the output window when debugging. You can specify other listeners in the application configuration file which can redirect trace output to a file, to the event log etc.

    Alternatively use a logging framework such as Log4Net.

提交回复
热议问题