Results 1 to 2 of 2

Thread: need some help on this one

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    toronto
    Posts
    12

    need some help on this one

    need to create a prog. that allows a user to logg in with username and password. If the password is incorrect a message should appear. Also a time limit to logg in, if the time expires a friendly messageshould appear.

  2. #2
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442
    This is just an simple example (also added it in the attachment)

    VB Code:
    1. Public Class Form1
    2.     Inherits System.Windows.Forms.Form
    3.  
    4.  
    5.     Dim UserName As String = New String("charles")
    6.     Dim Password As String = New String("mypass")
    7.     Dim intCount As Integer = New Integer()
    8.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    9.         If LCase(TextBox1.Text) = (UserName) And LCase(TextBox2.Text) = Password Then
    10.             MsgBox("Logged in...", MsgBoxStyle.Information, "Logged in..")
    11.         Else
    12.             If Not LCase(TextBox1.Text) = UserName Then
    13.                 MsgBox("Wrong username", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Auth.")
    14.                 Exit Sub
    15.             Else
    16.                 If Not LCase(TextBox2.Text) = Password Then
    17.                     MsgBox("Wrong password", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Auth.")
    18.                 End If
    19.             End If
    20.         End If
    21.     End Sub
    22.  
    23.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    24.         Form1.ActiveForm.Text = "Lalalal"
    25.     End Sub
    26.  
    27.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    28.         If intCount = 10 Then
    29.             intCount = 0
    30.             MsgBox("Too late!!", MsgBoxStyle.Critical, "too bad")
    31.             End
    32.         End If
    33.         intCount = (Val(intCount) + 1)
    34.         Label2.Text = intCount
    35.     End Sub
    36. End Class
    Attached Files Attached Files
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width