private TraceInformation ( string message ) : void | ||
message | string | |
return | void |
TraceSource traceSource = new TraceSource("MyTraceSource"); traceSource.TraceInformation("Informational message");
TraceSource traceSource = new TraceSource("MyTraceSource"); traceSource.Listeners.Add(new ConsoleTraceListener()); traceSource.TraceInformation("Informational message");This code creates a TraceSource object and adds a ConsoleTraceListener to it. The TraceInformation method is then used to log an informational message to the console. Package library: This library is part of the .NET Framework, and is included in the System.Diagnostics namespace.