用C#模仿批处理文件 [英] Mimic batch file with C#
本文介绍了用C#模仿批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个运行四个命令的批处理文件
I have a batch file that runs the four commands
vsinstr -coverage hello.exe
vsperfcmd /start:coverage /output:run.coverage
hello
vsperfcmd /shutdown
我
如何使用C#来运行四个命令?
How can I use C# to run the four commands?
推荐答案
使用运行命令的的Process.Start 。
示例
使用覆盖的Process.Start(字符串文件名,字符串参数)
Process.Start("vsinstr", "-coverage hello.exe");
Process.Start("vsperfcmd", "/start:coverage /output:run.coverage");
Process.Start("hello");
Process.Start("vsperfcmd", "/shutdown");
这篇关于用C#模仿批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文