using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace AudioVisualizerDx { internal static class Program { [DllImport("kernel32.dll")] public static extern bool AllocConsole(); [DllImport("kernel32.dll")] public static extern bool FreeConsole();//释放关联的控制台窗口 /// /// The main entry point for the application. /// [STAThread] static void Main() { #if DEBUG AllocConsole(); #endif // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new MainWindow()); #if DEBUG FreeConsole(); #endif } } }