[STAThread]
        static void Main(string[] args)
        {
            if (args.Length > 0) // Console Application
            {
                AttachConsole(-1);
                Console.WriteLine("");
                Console.WriteLine("Running in console, press ENTER to continue");
                Console.ReadLine();
            }
            else // Windows Application
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
        [System.Runtime.InteropServices.DllImport("kernel32.dll")]
        private static extern bool AttachConsole(int pid);

 

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-12-06
  • 2021-09-20
  • 2021-11-20
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2022-02-09
  • 2021-07-31
  • 2021-12-19
  • 2022-12-23
  • 2021-08-06
相关资源
相似解决方案