C#过程任务管理器杀死运行文件
我尝试使用C#中的进程打开文件,但是在该文件结束工作之后。
它不是任务管理器的结局。
我正在通过线程运行此
操作
Process cmd = new Process();
cmd.StartInfo.WorkingDirectory = currentDirectory;
cmd.StartInfo.FileName = Directory.GetCurrentDirectory() + "/fping.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.Arguments = pingcmd;
cmd.Start();
I try to open file using process in C#, but after that file end work.
It is not end from task manager.
I am running this by thread
how i can kill fping.exe from task manager after specific time
Process cmd = new Process();
cmd.StartInfo.WorkingDirectory = currentDirectory;
cmd.StartInfo.FileName = Directory.GetCurrentDirectory() + "/fping.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.Arguments = pingcmd;
cmd.Start();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
完成过程类工作后,您应该处置它。
要直接处置该类型,请在试用/最终阻止的情况下调用其处置方法。要间接处理它,请使用诸如
此处使用之类的语言构造是使用的示例
When you done working with the Process class, you should dispose of it.
To dispose of the type directly, call its Dispose method in a try/finally block. To dispose of it indirectly, use a language construct such as using
Here is example with using