Thread: kill process
View Single Post
  #1 (permalink)  
Old 06-23-2008, 05:02 AM
ostudioo ostudioo is offline
Newbie
 
Join Date: Jun 2008
Posts: 10
Rep Power: 0
ostudioo is on a distinguished road
Default kill process

im currently using this code..

using System.Diagnostics;

foreach (Process p in Process.GetProcesses())
{
if (p.ProcessName.ToLower() == "star")
if (p.ProcessName.ToLower() == "firefox")

p.Kill();
}
}

star and firefox are just examples of the .exe(s) running..
it doesn't quite work when I add another line of "if (p.ProcessName..etc)

also with the firefox line, how can I check for a specific website opened with firefox? ex.. "firefox", "www.google.com" ?
thanks ahead of time.
Reply With Quote

Sponsored Links