Debug class in C #

Source: Internet
Author: User

In the namespace System. 1. In Diagnostics. debug. print method Debug. print ("Today: {0}", DateTime. today); 1 Debug. print ("Today: {0}", DateTime. today); 2. debug. writeLine method Debug. writeLine ("Have a nice day"); 1 Debug. writeLine ("Have a nice day"); 3. the TraceListener class DelimitedListTraceListener specifies a file name when it is created. When it is called by Flush, It is overwritten to the file. TraceListener listener = new DelimitedListTraceListener (@ "C: \ debugfile.txt"); // Add listener. traceListener listener = new DelimitedListTraceListener (@ "C: \ debugfile.txt"); // Add listener. debug. listeners. add (listener); // Write and flush. debug. writeLine ("Welcome"); Debug. flush (); 4. debug. write, WriteIf, and WriteLineIf Methods Debug. writeLineIf (IsThursday (), "Thursday"); 1 Debug. writeLineIf (IsThursday (), "T Hursday "); the first parameter is a bool value, which is output if it is true. 5. Debug. Assert method Debug. Assert (value! =-1, "Value must never be-1."); 1 Debug. Assert (value! =-1, "Value must never be-1."); output if the expression is false.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.