Chapter 13 C # Exceptions and Debugging

This article is transferred from: http://m.biancheng.net/csharp/130/

Some errors will inevitably occur in programming. The errors mainly include compilation errors and logic errors.

Compilation errors are easy to find. If some red wavy lines appear in the code page of Visual Studio 2015, it means that the program cannot be run; and logic errors are difficult to find, and usually need to be found with the help of debugging tools.

In addition, there are some unpredictable problems during the running of the program, such as the exception when the string type is converted to an integer, and the divisor is 0.

In the C # language, exceptions are also called runtime exceptions, which are errors that occur during the running of a program.

Dealing with exceptions requires programmers to accumulate experience and add exception handling statements where possible exceptions occur.

In this chapter:
1.  C # Exception: Exception class
2.  C # try catch finally: exception handling
3.  C # custom exception (throw throw exception)
4.  C # Debug and Trace: output debugging information
5.  C # program debugging: VS2015 debugging program in detail

Guess you like

Origin www.cnblogs.com/hanguoshun/p/12729445.html