public void Run(object instance) { BfgMinerRunner runner = instance as BfgMinerRunner; if (runner == null) { return; } Process p = null; try { p = new Process(); p.StartInfo = new ProcessStartInfo(); p.StartInfo.FileName = runner.FileName; p.StartInfo.Arguments = runner.Arguments; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true;//让窗体不显示 p.Start(); //p.WaitForExit(); } catch (Exception ex) { LOG.Error(ex); } }
public void RunApplication(string fileName, MinerInfo config) { BfgMinerRunner runner = new BfgMinerRunner(fileName, config.GetCommandLine2()); ThreadPool.QueueUserWorkItem(new WaitCallback(runner.Run), this); }