Tag Archives: shutdown pc by c#

c# tips: execute windows shutdown ,restart ,logof command in c#

i make c# function for these command private void execute_command(String Comande) { if (Comande.CompareTo(“shutdown”) == 1) { System.Diagnostics.Process.Start(“shutdown”, “-s”); } else if (Comande.CompareTo(“restart”) == 1) { System.Diagnostics.Process.Start(“shutdown”, “-r”); } else if (Comande.CompareTo(“logoff”) == 1) { System.Diagnostics.Process.Start(“shutdown”, “-l”); } else if … Continue reading

Rate this:

Posted in C#, Winform app | Tagged , , , , , | 1 Comment