How to windows Lock computer using vb.net?
plz help me
thanx

try this

[B]  Private Declare Function LockWorkStation Lib "user32.dll" () As Long
    Private Declare Function ShutDownDialog Lib "shell32" Alias "#60" (ByVal any As Long) As Long

    Private Sub ShowShutdown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ShutDownDialog(0)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        LockWorkStation()
    End Sub[/B]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.