程序如下:
------------------------------------------------
#define DEBUGusing System;
using System.Diagnostics;class PlainDebugDemo
{
static void DebuggedMethod()
{
Debug.WriteLine("Debug:Entered MyMethod()");
} static void Main(string[] args)
{ TextWriterTraceListener myListener =
new TextWriterTraceListener(Console.Out); Debug.Listeners.Add(myListener); DebuggedMethod();
Console.Read(); }
}
问题:
------------------------------------------------
编译命令无论带不带"/d:DEBUG"参数,编译后的程序都会执行调试.
我要如何控制程序是否进行调试?
------------------------------------------------
#define DEBUGusing System;
using System.Diagnostics;class PlainDebugDemo
{
static void DebuggedMethod()
{
Debug.WriteLine("Debug:Entered MyMethod()");
} static void Main(string[] args)
{ TextWriterTraceListener myListener =
new TextWriterTraceListener(Console.Out); Debug.Listeners.Add(myListener); DebuggedMethod();
Console.Read(); }
}
问题:
------------------------------------------------
编译命令无论带不带"/d:DEBUG"参数,编译后的程序都会执行调试.
我要如何控制程序是否进行调试?
解决方案 »
- 解析XML问题
- 获取鼠标双击时间间隔问题,不论鼠标是否双击或双击速度,程序运行时始终显示时间为500毫秒,谢谢大家帮忙
- 怎么 用C#写个小程序自动备份文件啊?
- 在WinFrom中DataGridView控件的行单击查询事件
- 很简单的问题,大虾们帮帮忙.
- web里如何实现treeview???
- 求助 在方法中需要获取一个实体异步返回的值怎么获取?
- 关于水晶报表的问题
- 高分求购Magic Library的源代码
- 分别出来控件和他的容器的透明属性.
- public class PrintGridDocument:PrintDocument,,,在页面设置里改为横向,但在预览里还是竖的。??????
- DataAdapter.Update的问题,请各位帮帮忙,郁闷很长时间了(偶穷,请海涵)...
#if DEBUG
#endif
在哪?
你现在只是相当于只定义了一个常量,而没有使用。