5583301
1.debug only executes in debug mode (The drop-down box after the Run button is optional)
The 2.debug provides many debug directives, such as assertions
System.Diagnostics.Debug.Assert (False, "information");
A dialog box will appear
3.debug can customize the listener
(The following example deposits information into a disk file)
System.Diagnostics.TextWriterTraceListener t=new System.Diagnostics.TextWriterTraceListener (@ "C:/a.txt");
SYSTEM.DIAGNOSTICS.DEBUG.LISTENERS.ADD (t);
System.Diagnostics.Debug.WriteLine ("Information");
T.flush ();
4. What is the difference between Debug and Console.Write ()?
Debug time window output to IDE when running state (for Windows Forms programs)
The Console.Write is used in the console program, where the program can output information to the console (that is, the DOS interface) at runtime.
The two are also inputs, but debug is output to the outputs window, and the console is output to the control window,
And debug must be in the debug case to be effective, you press CTRL+F5 will see the console output,
The output of the console can also be seen after pressing F5, as well as the output of debug in output
C # debug Debug information printing and output detailed