private void Main_Load(object sender, EventArgs e) { try { OperationsVersions = new OperationsVersions(); OperationsFiles = new OperationsFiles(); OperationsProducts = new OperationsProducts(); Server = new Services.Server(OperationsFiles, OperationsVersions); CheckerStatus_T.Start(); logger.Info("Сборка пройдена успешно"); Server.Start(); logger.Info("Запуск сервера успешно выполнен"); ShowProducts(); using (RegistryKey registryKeyStartup = Registry.CurrentUser.OpenSubKey(pathRegistryKeyStartup, true)) { value = (String)registryKeyStartup.GetValue("SZMK.ServerUpdater"); } if (!String.IsNullOrEmpty(value)) { AddAutoRun_TSM.Text = "Удалить из автозагрузки"; } } catch (Exception Ex) { Error(Ex); } }
private void StartServer_B_Click(object sender, EventArgs e) { try { if (!Server.GetStatus()) { Server.Start(); } else { Info("Сервер уже запущен"); } } catch (Exception Ex) { Error(Ex); } }
private void Main_Load(object sender, EventArgs e) { try { OperationsVersions = new OperationsVersions(); OperationsFiles = new OperationsFiles(); OperationsProducts = new OperationsProducts(); Server = new Services.Server(OperationsFiles, OperationsVersions); CheckerStatus_T.Start(); logger.Info("Сборка пройдена успешно"); Server.Start(); logger.Info("Запуск сервера успешно выполнен"); ShowProducts(); } catch (Exception Ex) { Error(Ex); } }
static void Main(string[] args) { var server = new Services.Server(args.Length == 0 ? 8888 : int.Parse(args[0])); server.Start(); }