.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Login with shutdown

Posted By:laptop charles       Posted Date: August 12, 2010    Points: 5    Category: Visual Studio    URL: http://www.dotnetspark.com  

Login validation and has a shutdown and hibernate and restart option
 

It has used Five button one is user login ,one is clear button then one is shutdown ,one is hibernate and last one is restart button.
Public Class Form1

   
    Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loginbtn.Click
        Dim a, b As String
        a = t1.Text
        b = t2.Text

        If a = "charles" And b = "char" Then

            
            MsgBox("login")
         
        ElseIf a = "charles" Then
            MsgBox("Password is wrong")
        ElseIf b = "char" Then
            MsgBox("User name is wrrong")
        Else
            MsgBox("Username and Password is wrong")


        End If

    End Sub

    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'System.Diagnostics.Process.Start("shutdown ", "-s -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", "-r -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", "-h -t 00")
    End Sub

    Private Sub canclebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles canclebtn.Click
        t1.Text = ""
        t2.Text = ""

    End Sub

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend