In a client server enviornment, how to make other system(client) log off using programming statement written in .net ? i am developing an application which will control the log off of other systems. should i use some windows API ?
System.Diagnostics.Process.Start("shutdown", "-l -t 00")
Private Sub On Stringreceived (depending on how you are sending the data)
Dim NewInformation = Received String
If NewInformation = "Log Off Computer" Then
System.Diagnostics.Process.Start("shutdown", "-l -t 00")
End If
End Sub
rivate Sub btnShutdown_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShutdown.Click
System.Diagnostics.Process.Start("shutdown", "-s -t 00")
'This will make the computer Shutdown
End Sub
Private Sub btnRestart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRestart.Click
System.Diagnostics.Process.Start("shutdown", "-r -t 00")
'This will make the computer Restart
End Sub
Private Sub btnLogOff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogOff.Click
System.Diagnostics.Process.Start("shutdown", "-l -t 00")
'This will make the computer Log Off
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
Me.ShowInTaskbar = False
End Sub