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 Isaac19 reputationPosted Jun 14, 2007, 5:22 AM EDT
{
///
///
/// 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();
}
}
David Isaac19 reputationPosted Jun 14, 2007, 1:11 AM EDT
NeCroFire82 reputationPosted Jun 14, 2007, 3:25 AM EDT
NeCroFire82 reputationPosted Jun 14, 2007, 6:20 AM EDT