static void Main() { Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); key.SetValue("DialogCustomerMessageServer", Application.ExecutablePath.ToString()); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); System.Threading.Thread.Sleep(800); PortConfigClass callServer = new PortConfigClass(); String portName = callServer.dialogServer(); Application.Run(new DialogSplashWindow()); if (portName != "") { Application.Run(new DialogNotificationWindow(portName)); } else { Application.Run(new DialogNotificationWindow("")); } }
static void Main() { Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); key.SetValue("DialogCustomerMessageServer", Application.ExecutablePath.ToString()); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new DialogSplashWindow()); PortConfigClass callServer = new PortConfigClass(); if (callServer.dialogServer()) { Application.Run(new DialogNotificationWindow(callServer._truePortName)); } else { MessageBox.Show(callServer._PortMessage, "Message Server Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop); Application.Exit(); } }