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:


