public override void Start() { if (!IsRunning() && PortScanHelper.IsPortInUseByTCP(Common.Settings.PHP_Port.Value)) { Log.wnmp_log_error("Port " + Common.Settings.PHP_Port.Value + " is used", progLogSection); } else if (!IsRunning()) { for (int i = 0; i < Common.Settings.PHPProcesses.Value; i++) { StartProcess(this.exeFile, this.startArgs, (s, args) => { DecreaseFCGINum(); }); IncreaseFCGINum(); } WatchPHPFCGINum(); Log.wnmp_log_notice("Started " + programName, progLogSection); } }
public override void Start() { if (IsRunning()) { return; } try { if (!File.Exists(Common.APP_STARTUP_PATH + Common.Settings.MysqlDirName.Value + "/my.ini")) { Log.wnmp_log_error("my.ini file not exist", progLogSection); return; } int port = GetIniMysqlListenPort();// -1表示提取出错 if (port != -1 && PortScanHelper.IsPortInUseByTCP(port)) { Log.wnmp_log_error("Port " + port + " is used", progLogSection); return; } mysqlController.Start(); Log.wnmp_log_notice("Started " + programName, progLogSection); } catch (Exception ex) { Log.wnmp_log_error("Start(): " + ex.Message, progLogSection); } }
private void btnScan_Click(object sender, RoutedEventArgs e) { lvConditions.ItemsSource = PortScanHelper.GetPortInfoList(); }