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 (Comande.CompareTo("abort") == 1)
{
System.Diagnostics.Process.Start("shutdown", "-a");
}
}

Advertisements

About kishordgupta

A software developer
This entry was posted in C#, Winform app and tagged , , , , , . Bookmark the permalink.

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

  1. tanvir says:

    sir plz can u send the source code of this project to me
    becoz i want same project for submission my email id is “tanvirs47@gmail.com”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s