public void Dispose() { if (Disposed) { return; } try { if (!(RunProcess?.HasExited ?? true)) { RunProcess?.Kill(); } if (File.Exists(FilePath)) { File.Delete(FilePath); } Console.WriteLine("Deleted temp file {0}", FilePath); } catch (Exception exc) { Console.WriteLine(exc.Message); } Disposed = true; }
public void Exit() { if (RunProcess != null && RunProcess.HasExited == false) { try { RunProcess.Kill(); RunProcess.Close(); } catch { } } SetListViewInfo("未运行"); IsRun = false; RunProcess = null; }