public static void Main(string[] Args) { try { foreach (string temptemp in Args) MessageBox.Show(temptemp); SplashScreen.ShowSplashScreen(); Application.Run(new frmMain()); } catch (Exception e) { Debug.WriteLine(e.ToString()); try { StreamWriter writer = new StreamWriter(Application.StartupPath + @"\error.log", true); writer.WriteLine("-------------------------------------------------------------------------"); writer.WriteLine(System.DateTime.Now.ToString()); writer.WriteLine("-------------------------------------------------------------------------"); writer.Write(e.ToString()); writer.WriteLine("\n\n"); writer.Close(); } catch (Exception){} Debug.WriteLine(e.ToString()); MessageBox.Show("An unexpected error has occured.\n\nPlease restart your computer and try again.\n\nIf the error persists, please contact Commonwealth Brands helpdesk", "Unexpected Error!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error, System.Windows.Forms.MessageBoxDefaultButton.Button1); } }