接受CLI参数winform应用程序打开时运行新的控制台窗口,但我想它在CLI运行,而不是和返回任何Console.WriteLine()的有
这是我打出了GUI,控制台
static class program{
[STAThread]
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern bool AllocConsole();
static void Main(string[] args){
if (args.Length > 0)
{
AllocConsole();
Console.WriteLine("Yo!");
Console.ReadKey();
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new someForm());
}
}
}
“呦!” 出现在新的控制台窗口,但我想它的命令接口