0

我刚刚安装了 VS 社区版,并尝试运行简单的 I/O 代码,但 VS 只是跳过了我必须以用户身份输入一些信息的部分:

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LetsGetStarted
{
    static class Program
    {
    
        static void Main()
        {
            Console.WriteLine("Random stuff that do get executed by program.");
            string example = Console.ReadLine(); //this part is just skipped
            Console.ReadLine(); //this part is just skipped
        } 
    }    
}

这就是它所说的,你可以看到它跳过 Console.ReadLine(),并且从不让我输入任何内容。 我搜索了诸如“如何在 vs 社区版中运行 C#”之类的内容,但只是找到了有关 vs 代码的内容(不一样)。一切似乎都很好,除非我必须输入一些东西。为什么它不让我与控制台交互,我该如何修复它以便我可以与控制台交互?还有我如何运行它以便弹出终端,而无需我指定 ./directory (或类似的东西)?提前致谢!!!

4

0 回答 0