How to debug your C # Program
Welcome to the wonderful sky of C #. Here, I hope you can get what you want ,. we sincerely hope to bring you great help and bring you into another broad space.
Come on. Follow me and then U can Win!
Similar to gdb in Gnu C ++ in Linux, C # provides a command line debugging program "Cordbg.exe ", through this program, you can easily debug your C # application. This article cannot completely introduce you to the function of cordbg below. I just hope that through the introduction in this article, you can get something. It is a pleasure for me to help you. Just talk nonsense!
Cordbd: Microsoft (R) Common Language Runtime Test Debugger Shell
I do not define this stuff for the time being. Let's take a look at it step by step:
My machine configuration: Win2K Professional + iis 5.0 + Microsoft. NET Framework SDK (Beta2)
Let's start a simple program:
Test-1.cs
/*
Data: 2001-12-13
Author: Longshan Culture
FileName: Test-1.cs
One Csharp Test Program
*/
Using System;
Class Test_1
{
Static void Main ()
{
String str;
Console. WriteLine ("Please Enter Your Name. Thanks! ");
Str = Console. ReadLine ();
Console. WriteLine ("------------------------------------");
Console. WriteLine ("Dear" + str + ", Welcome To Csharps World! ");
Console. WriteLine ("------------------------------------");
}
}
The above program is extremely simple, and I will use a complicated example for debugging in the subsequent articles. Let's start step by step!
But please note that I use "/*... ... */"To mark comments and descriptions of related texts.
Start-> Run-> Cmd, OK. Now a Dos window is opened to compile your C # program. (All the following input actions are a complete debugging process. Do not confuse the comments I added later. Also, determine the data that I input based on the color, and the data that is output by the computer)