static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //If crush, call CrushHandler //只允許單一執行個體 SingelApp myapp = new SingelApp(); myapp.Run(args); if (args.Length > 0) { if (args[0] == "-M") { //強制手動選擇路徑 Variable.forceSelectPath = true; } } //清理下載資料夾 foreach (string s in Directory.GetFiles(Variable.CurrentDirectory + "\\download")) { File.Delete(s); } }
static void Main(string[] args) { if (args.Length != 0) { if (args[0] == "-M") { Variable.forceSelectPath = true; } } foreach (string s in Directory.GetFiles(Application.StartupPath + "\\download")) { File.Delete(s); } AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //If crush, call CrushHandler //只允許單一執行個體 SingelApp myapp = new SingelApp(); myapp.Run(args); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new ServerSelect()); }