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

Top 5 Contributors of the Month
Gaurav Pal

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

 Subscribe to Code Snippets

Simple login authentication

Posted By:laptop charles       Posted Date: December 31, 2010    Points: 15    Category: Visual Studio    URL: http://www.dotnetspark.com  

It is simple login validation coding.In client side.

it has two textbox and two buttons. Textbox one is username,other one is password..button one is login and other one is clear.
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a, b As String
        a = TextBox1.Text
        b = TextBox2.Text

        If a = "charles" And b = "beat" Then
        ElseIf a = "charles" And b = "" Then
            MsgBox("Please Enter Password")
        ElseIf a = "charles" And b = b Then
            MsgBox("Password is Wrong")
        ElseIf a = "" And b = "beat" Then
            MsgBox("Please Enter Username")
        ElseIf a = a And b = "beat" Then
            MsgBox("User name is wrrong")
        ElseIf a = "" And b = "" Then
            MsgBox("Please Enter Username")
            MsgBox("Username and Password is wrong")

        End If
    End Sub
End Class


Further Readings:


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