如何通过 C# 程序运行记事本或计算器等外部程序?
最佳答案
也许它会对你有所帮助:
using(System.Diagnostics.Process pProcess = new System.Diagnostics.Process())
{
pProcess.StartInfo.FileName = @"C:\Users\Vitor\ConsoleApplication1.exe";
pProcess.StartInfo.Arguments = "olaa"; //argument
pProcess.StartInfo.UseShellExecute = false;
pProcess.StartInfo.RedirectStandardOutput = true;
pProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pProcess.StartInfo.CreateNoWindow = true; //not diplay a windows
pProcess.Start();
string output = pProcess.StandardOutput.ReadToEnd(); //The output result
pProcess.WaitForExit();
}
关于c# - 如何通过 C# 程序运行外部程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3173775/