1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
Application.Restart();
Form1 form1 = new Form1();
form1.StartFileWatcher();
} |
Partager