//System.Diagnostics.Process[] pro = System.Diagnostics.Process.GetProcessesByName("EXCEL");
//foreach (System.Diagnostics.Process p in pro)
//{
// if (!string.IsNullOrEmpty(p.ProcessName))
// {
// try
// {
// p.Kill();
// }
// catch (Exception)
// {
// throw;
// }
// }
//}
//GC.Collect();
//foreach (System.Diagnostics.Process p in pro)
//{
// if (!string.IsNullOrEmpty(p.ProcessName))
// {
// try
// {
// p.Kill();
// }
// catch (Exception)
// {
// throw;
// }
// }
//}
//GC.Collect();

本文介绍如何使用C#编程语言批量查找并关闭所有名为'EXCEL'的进程实例,同时执行垃圾回收操作,确保内存资源的有效利用。
526

被折叠的 条评论
为什么被折叠?



