初学C#,写了个简单的hello world程序,为何在命令行窗口停不住呀?一闪而过.谢谢先
---------------
代码如下:
using System; class hello
{ static void Main()
{
Console.WriteLine("please enter your name:");
Console.ReadLine();
Console.WriteLine("hello,world!"); }
}

解决方案 »

  1.   

    Console.WriteLine("please enter your name:");
    Console.ReadLine();
    Console.WriteLine("hello,world!");
                               Console.ReadLine();
      

  2.   

    可以先打开一个命令行窗口,在开始菜单中“运行..”中输入“cmd”即可然后从此窗口中用命令行运行你编译得到的*.exe文件,在你的.cs文件下的debug或release目录下
      

  3.   

    最后加一句
    Console.ReadLine();
      

  4.   

    ctrl+F5运行
    如果你是在VS环境中
      

  5.   

    选择[调试]-->[开始执行(不调试)]
    就是ctrl+F5
      

  6.   

    最后面加上Console.ReadLine(); 或者Console.Read();即可