Honestly, there is nothing to write in this chapter, and many of them are practical.
You can use Debug. WriteLine () and Trace. WriteLine () to input debugging information to the output window in the form. However, you have never used the debugging information. You can set the breakpoint more effectively:
You can right-click the breakpoint and set some conditions to determine whether the conditions are met before execution. When the breakpoint is reached, the program will interrupt execution, and a local variable information will appear below the window:
In the current state, the program will be executed Statement by statement based on F11, and the value of the variable will also change in the window of the local variable.
There are also Debug. Assert () and Trace. Assert () Functions with three parameters, as shown below:
int[] myIntArray = { 1, 2, 3 }; int myInt = myIntArray[3]; for (int i = 10; i > 1; i--) { Console.Write(i); Debug.Assert(i < 5,"the i not small 5","from main for"); }
The effect achieved by the function is similar to the following:
Use try... catch... finally. You can only use try and finally blocks without catch blocks, or have one try block and several catch blocks. If one or more catch blocks exist, finally blocks are optional; otherwise, they are required.
This is nothing to remember. In actual use, you can go back and view it as needed.
Finally ~~~ After reading the first seven chapters, I tried to use the learned knowledge to improve the previous procedures over the past one or two weeks. Then, hey, you can start with "C # Getting Started classic (version 6th.