shutting down the system by using C#

Started by OmMuruga, Jan 14, 2009, 01:07 PM

Previous topic - Next topic

OmMuruga

 

BY USING VISUAL STUDIO 2008:    1.Create a Project in Visual Studio by File->New->Project and in that Dialog Box Click the Windows Application and the give a name to it .

    2.And then a Form will be appeared in the window .Make the Toolbox viewable by using the View->Toolbox.The Toolbox Tab will be obtained .In the Toolbox Tab ,Drag and Drop the Button from the Toolbox to the Form .

    3.Double-Click the Button so that a Button _Click Event will be generated .Then in the Event type the Following Code:-


  Process.Start("shutdown.exe", "-s -t 00");


And then Run the Project by pressing F5 in the Key word .Now a (exe) Form is displayed .In that Form when u click the Button .You can see that your system is Shutting Down ... :acumen