How to ShutDown Restart Logoff Computer In VB.Net

Q.: Create a Windows Application in VB.Net which is used to ShutDown or Restart or Log Off computer.

In VB.Net 2008, sometimes we have require to Shut Down Restart Logoff computer. This Example Shows to ShutDown Restart Logoff computer.

Compatibility/Version:  Microsoft Visual Studio 2008 (Microsoft .Net Framework 3.5)

Source Code:

Public Class form1

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
 End
 End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 System.Diagnostics.Process.Start("shutdown", "-l -t 00")
 End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
 System.Diagnostics.Process.Start("shutdown", "-s -t 00")
 End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
 System.Diagnostics.Process.Start("shutdown", "-r -t 00")
 End Sub
End Class

Output:

Download Now (.Zip File 250 KB)…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.