public void Start() { var killed = new List <Process>(); foreach (var p in Utils.SearchProcess("frpc", FrpcPath)) { try { Main.LogManager.Log(LogManager.CATEGORY_SERVICE_INFO, Tag, "正在结束残留 frpc 进程: #" + p.Id); p.Kill(); killed.Add(p); } catch { } } Parallel.ForEach(killed, p => { try { if (!p.WaitForExit(1000)) { Main.LogManager.Log(LogManager.CATEGORY_SERVICE_ERROR, Tag, "无法结束残留 frpc 进程: #" + p.Id); } } catch { } }); AsyncManager.Start(); }
public void Start() { if (!Enabled || Running || EncryptKey == null || EncryptKey.Length == 0) { return; } Source = new CancellationTokenSource(); AsyncManager.Start(); }
public void Start() { foreach (var p in Utils.SearchProcess("frpc", FrpcPath)) { try { p.Kill(); } catch { } } AsyncManager.Start(); }
public void Start() => AsyncManager.Start();