以下是代码:
Process process = new Process();
string exePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "a.exe");
string s = "";
foreach (var tmpArg in args)
{
s += tmpArg.ToString() + " ";
}
s = s.Trim();
if (string.IsNullOrWhiteSpace(s))
{
throw new Exception("缺少参数");
}
ProcessStartInfo psi = new ProcessStartInfo(exePath , s)
{
CreateNoWindow = true,
UseShellExecute = false,
};
process.StartInfo = psi;
process.Start();
process.WaitForExit();