Publier Profil Docs FAQ

Solution

Tuer un processus


Tuer un processus comme la commande killall sur Linux

 

private static void killall (String task)

{

          ProcessStartInfo pi = new ProcessStartInfo ("taskkill.exe");

          pi.UseShellExecute = false;

          pi.RedirectStandardOutput = false;

          pi.Arguments = "/f /im " + task;

          Process p = Process.Start (pi);

          p.WaitForExit ();

}

 

 

Cette fonction utilise la référence System.Diagnostics