zoukankan      html  css  js  c++  java
  • C#在代码中编写输出debug信息-类Debug的使用

    文章:C# 的两种debug 方法

    文章:C#跟踪和调试程序-Debug类使用

    很全面的文章,可以仔细学习使用下。

    文章:C#调试类

    没有仔细看。

    关键字:Debug类和Trace类有什么区别?

    微软资料:https://docs.microsoft.com/zh-cn/dotnet/api/system.diagnostics.debug?redirectedfrom=MSDN&view=netframework-4.8

    标题:Debug Class

    类的作用:提供一组有助于调试代码的方法和属性。

    示例代码:

    // Specify /d:DEBUG when compiling.
    
    using System;
    using System.Data;
    using System.Diagnostics;
    
    class Test
    {
        static void Main()
        {
           Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
           Debug.AutoFlush = true;
           Debug.Indent();
           Debug.WriteLine("Entering Main");
           Console.WriteLine("Hello World.");
           Debug.WriteLine("Exiting Main"); 
           Debug.Unindent();
        }
    }

    详细信息需要看微软的网站。

  • 相关阅读:
    csp-s模拟103
    csp-s模拟102
    csp-s模拟101
    csp-s模拟100
    csp-s模拟99
    csp-s模拟98
    csp-s模拟97
    csp-s模拟96
    csp-s模拟95
    csp-s模拟94
  • 原文地址:https://www.cnblogs.com/Tpf386/p/11465049.html
Copyright © 2011-2022 走看看