


//using System.Diagnostics;
public void RunExe(string ExeFileName, string ParaString)
{
try
{
//如果有在运行了,先干掉,然后再运行
if (ExeFileName.ToUpper().EndsWith("EXE"))
{
Process[] p = Process.GetProcessesByName(ExeFileName.Substring(0, ExeFileName.Length - 4));
foreach (Process p1 in p)
{
p1.Kill();
}
}
Process.Start(ExeFileName, ParaString);
}
catch (Exception ex)
{
MessageBox.Show("程序发生错误!");
}
}



亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论