Hello a tous qui peux me dire ou est l’erreur dans le code suivent tous me semble juste mais rien ne se passe

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
public string StopPc(string nompc)
{
 
System.Diagnostics.Process Processstop = new System.Diagnostics.Process();
Processstop.StartInfo.UseShellExecute = true;
 
//Processstop.EnableRaisingEvents = true;
Processstop.StartInfo.FileName = @"C:\WINDOWS\system32\shutdown";
Processstop.StartInfo.Arguments = @"/s /m \\"+nompc;
// Attribution des infos d'exéctuion au processus
Processstop.Start();
// Libération du processus pour libérer la mémoire
Processstop.Dispose();
}