Kill process??
Hi
When I save my data to Excel, a thread is started and when it's done it closes the thread. It seemed to work well without any problem. But after I got it working I noticed that I was running 96 processes!! If an error occurs while it is sending the data to the excel file, the thread does not get killed.
So, how do I kill "EXCEL.EXE" thread??
David IsaacPosted Jun 14, 2007, 9:22 AM
{
///
///
/// if(string.IsNullOrEmpty(machineName))
machineName = ".";
Process[] procs = Process.GetProcesses(machineName);
return procs;
} public void KillProcess(string processName) //Process name "EXCEL"
{
foreach (Process p in GetRunningProcesses(string.Empty))
{
if (p.ProcessName == processName)
p.Kill();
}
}
NeCroFirePosted Jun 14, 2007, 10:20 AM
NeCroFirePosted Jun 14, 2007, 7:25 AM
David IsaacPosted Jun 14, 2007, 5:11 AM