using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace TestForm { internal static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { //// 指定栈的大小为1MB //const int StackSize = 1024 * 1024; //// 设置主线程栈的大小 //Thread mainThread = Thread.CurrentThread; //if (Environment.OSVersion.Platform == PlatformID.Win32NT) //{ // if (!mainThread.SetThreadStackGuarantee(StackSize)) // { // Console.WriteLine("设置主线程栈的大小失败"); // } //} Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }