【问题标题】:Is there a way to open a new console window from a console application in c# [duplicate]有没有办法从 C# 中的控制台应用程序打开一个新的控制台窗口 [重复]
【发布时间】:2019-12-09 14:25:07
【问题描述】:

我们想欺骗我们的老师,我们想在他输入无效的内容(任意值)时启动一个新的控制台窗口。

有没有一种方法可以让我们从 Main 启动一个新的控制台窗口?

using System;
using System.Diagnostics;

static void Main(string args)
{
    Process.Start();
}

【问题讨论】:

标签: c#


【解决方案1】:

当然;)

System.Diagnostics.Process.Start("CMD.exe");

【讨论】:

  • 谢谢你,我们是初学者,我们无法破译其他答案!
  • 编辑:NVM,我很笨,我想通了;)感谢您的帮助嘿,很抱歉再次打扰您,但我们只是尝试了这个,它没有添加新的控制台窗口,而是打印 (c) 2019 Microsoft Corporation. All rights reserved. 然后换行
猜你喜欢
  • 1970-01-01
  • 2011-12-24
  • 2016-03-30
  • 1970-01-01
  • 1970-01-01
  • 2019-01-18
  • 1970-01-01
  • 2011-01-20
  • 1970-01-01
相关资源
最近更新 更多