C# 如何使程序自动重启 我现在写了一个监测一个程序运行的程序,当发现一个程序A终止时想让这个程序A自动重启,请问用C#应该怎样设置自动重启??主要程序代码是什么,谢谢了!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用System.Diagnostics.Process放到timer控件里一直运行 if (System.Diagnostics.Process.GetProcessesByName("程序A").Length == 0) { System.Diagnostics.Process.Start("程序A.exe"); } System.Diagnostics.Process.Start(Application.ExecutablePath); process.Exited += new EventHandler(Process_OnExit);void Process_OnExit(object sender, System.EventArgs e){ Process curr = (Process)sender; curr.StartInfo.FileName = processPath; curr.StartInfo.UseShellExecute = true; curr.Start()} processPath = process.MainModule.FileName;少写了一句话 C# WF4.0 线程和并行的疑问 用C# GDI+绘制曲线 ComboBox DropDownStyle 设置成simple回车会清空文本? 急,急,急字段的比较判断?? 实现c# 添加集合编辑器的上下按钮功能 皮肤文件bug,怎么办?大家来帮忙!!!! C# 怎么收缩数据库 各位大大 谁给我解答一下 从启动后就不能调试 关于编译的问题,昨天没说清楚。 Properties.Settings.Default.Reset(); 大哥们 酒店客房预定文档 谁做过呀,数据库有人弄过没,帮忙讨论下谢了 通过Assembly来动态加载DLL的控件的Anchor设置不起作用?(满分求解)
{
System.Diagnostics.Process.Start("程序A.exe");
}
void Process_OnExit(object sender, System.EventArgs e)
{
Process curr = (Process)sender;
curr.StartInfo.FileName = processPath;
curr.StartInfo.UseShellExecute = true;
curr.Start()
}