How to make Shutdown Utilities
In this tutorial we are creating a shutdown utility program using the Visual Basic .NET, the tutorial is basically more calling the Shell to execute the shutdown, restart and log off features of your operating system. So, let’s start.
Things we need:
Microsoft Visual Basic .NET 2013 or later (I’m using Visual Basic 2010)
Step 1:
Create a New Project, name it ShutdownUtilities (see Image below)
Step 2:
Step 3:
Add 3 GroupBox, then Select the 1st GroupBox and change the Text Property to Shutdown, then if you want to change the Forecolor, just go to Forecolor Property change it to Highlight, do this in other 2 GroupBox with a Text Property of Restart and Log Off. (Please refer the image below).
Step 4:
Add 3 Buttons, then follow the settings below:
1st Button Property
Name: btnShutdown
Text: SHUTDOWN
2nd Button Property
Name: btnRestart
Text: RESTART
3rd Button Property
Name: btnLogOff
Text: LOG OFF
The Final Output
Copy and Paste the Code in your Code Editor
Things we need:
Microsoft Visual Basic .NET 2013 or later (I’m using Visual Basic 2010)
Step 1:
Create a New Project, name it ShutdownUtilities (see Image below)
Step 2:
Next, Add a New Form
by navigating in Project Menu and Click Add Windows Form…
Step 3:
Add 3 GroupBox, then Select the 1st GroupBox and change the Text Property to Shutdown, then if you want to change the Forecolor, just go to Forecolor Property change it to Highlight, do this in other 2 GroupBox with a Text Property of Restart and Log Off. (Please refer the image below).
Step 4:
Add 3 Buttons, then follow the settings below:
1st Button Property
Name: btnShutdown
Text: SHUTDOWN
2nd Button Property
Name: btnRestart
Text: RESTART
3rd Button Property
Name: btnLogOff
Text: LOG OFF
The Final Output
Copy and Paste the Code in your Code Editor
That's it, you now have shutdown utility, Enjoy..Happy Coding!Public Class Form1Private Sub btnShutdown_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShutdown.ClickShell("shutdown -s")End SubPrivate Sub btnRestart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRestart.ClickShell("shutdown -r")End SubPrivate Sub btnLogOff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogOff.ClickShell("shutdown -l")End SubEnd Class
How to make Shutdown Utilities
Reviewed by code-dev
on
10:19 PM
Rating:
No comments: