调试技巧:debug类

    科技2022-07-16  124

    适用于在断点停止之前, 想做一些打印输出

    debug.writeline(string message)函数,将我们所关心的信息打印在visual studio ide的output窗口中 debug.assert(bool condition)来让程序停在错误的地方

    e.g.:

    protected override void onresize(eventargs e) { system.diagnostics.debug.assert(this.width>200,"width should be larger than 200."); system.diagnostics.debug.writeline(size.tostring()); }
    Processed: 0.009, SQL: 8