【问题标题】:How do I get Visual Studio to not close terminal window when program terminates?程序终止时如何让 Visual Studio 不关闭终端窗口?
【发布时间】:2014-05-01 03:49:30
【问题描述】:

在调试模式下运行时,是否有其他方法可以不关闭 Visual Studio 中的终端窗口?我知道我可以“cin >>垃圾”;让它等待输入,我可以在其中设置一个断点,但这是仅有的两种方法吗?似乎调试编译器设置中应该有一个设置,但我可以在上面找到任何东西。有人知道吗?

【问题讨论】:

    标签: debugging visual-studio-2012 return terminate


    【解决方案1】:

    简单的解决办法就是自己动手:

    public void Main(){
        try {
            // Do your thing
        }
        catch (Exception ex) {
            Console.WriteLine(ex);
        }
        finally {
            Console.Write("ENTER to exit: ");
            Console.ReadLine();
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2019-01-04
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 2018-11-26
      • 1970-01-01
      • 1970-01-01
      • 2020-09-19
      相关资源
      最近更新 更多