using System;
using System.Windows.Forms;namespace Test
{
    class Test
    {
        static void Main(string[] args)
        {
            MessageBox.Show("Welcome to C# programming!");
        }
    }
}
这是我的程序.我是照书上打的.可以却不能编译.The name 'MessageBox' does not exist in the current context D:\WorkSpace\Test\Test\Program.cs 10 12 可以我在HELP的INDEX中能搜到 MessageBox.Show 这个方法啊.我是新手,高手指点一下啊.

解决方案 »

  1.   

    在"引用"中添加System.Windows.Forms.dll.
      

  2.   

    如果是控制台程序,这个是用不了,
    必须是GUI的程序才行
      

  3.   

    我就是在控制台程序中写的.呵呵,我知道啦~~已经搞定了.原来我是没有添加System.Windows.Forms到我的References中,这些具体都是啥我还不太清楚,不过现在程序已经能跑起来了.呵.结帖啦~~分就给回帖的吧.
      

  4.   

    using System;
    using System.Windows.Forms;namespace Test
    {
        class Test:Form
        {
            static void Main(string[] args)
            {
                MessageBox.Show("Welcome to C# programming!");
            }
        }
    }你没有继承Form