看以下代码
using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("myfunc() function about to be called.");
Debug.WriteLine("added 1 to i", "myfunc");
}
}
}
实际上我也只是看一下书关于debug 的用法,看是不是跟VB中的一样,结果呢发现C#不支持这个关键字,不知道为什么,请高人指点.(提示错误是上下文中不存在名称"Debug")
using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("myfunc() function about to be called.");
Debug.WriteLine("added 1 to i", "myfunc");
}
}
}
实际上我也只是看一下书关于debug 的用法,看是不是跟VB中的一样,结果呢发现C#不支持这个关键字,不知道为什么,请高人指点.(提示错误是上下文中不存在名称"Debug")
解决方案 »
- 垃圾回收与终结
- F#与C#的发展定位是什么
- 如何用DO-WHILE输出九九乘法表(在C#中)
- 聊天代码问题
- 关于response.redirect 问题
- SQL求救!
- ▲▲▲在winform的DataGrid中,我想给DataGrid的每行赋于不同的颜色,怎么实现呀?▲▲▲
- 如何把程序中用到的图标、图象之类的文件全部编译到一个EXE中?
- 高分寻求VISUAL STUDIO .NET 2003正确、快速、有效下载地址![在线等待]
- 如何在winform 中的datagrid 中使用 combobox列?
- C#初学者小问题之一——关于ArrayList的ReadOnly
- 怎样上传大容量视频格式文件?
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("myfunc() function about to be called.");
Debug.WriteLine("added 1 to i", "myfunc");
}
}
}
这样子写吗,运行也错误.
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("myfunc() function about to be called.");
Debug.WriteLine("added 1 to i", "myfunc"); }
}
}
这样子就没有问题了,谢谢各位,但using System.Diagnostics;
起什么作用的呢,请指点一下,非常感谢.
如果不using ,写
System.Diagnostics.Debug 也可以.