Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> C#

Debug Class vs Debugger Class trong C#

Để debug code, dùng methods/properties của Debug Class. Debugger Class dùng để giao tiếp với debugger.

Debug Class

Kế thừa System.Diagnostics. Syntax: public static class Debug

STTProperty & Mô tả
1AutoFlush - Flush Listeners tự động
2IndentLevel - Mức thụt lề
3IndentSize - Số space trong indent
4Listeners - Collection listeners

Debugger Class

Cũng kế thừa System.Diagnostics, enable communication với debugger, không thể inherit. Syntax: public sealed class Debugger

Chỉ có 1 property:

STTProperty & Mô tả
1IsAttached - Debugger có attach vào process không