Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Dec 19th, 2008, 3:35 AM   #1
kitchenknife
Newbie
 
Join Date: Nov 2008
Posts: 5
Rep Power: 0 kitchenknife is on a distinguished road
multiple user login system

Hi, I have written some code for a basic login system, however at the moment it only allows for one user, can anyone tell me how to create it so i can have multiple users??

Private Sub Form_Load()
    ' Open the data file.
    fnum = FreeFile
    Open App.Path & "\Files\test.txt" For Random As fnum Len = Len(SaveUser)

    ' Save the records.
        Get #fnum, i + 1, SaveUser
        Username = Trim$(SaveUser.Username)
        Password = Trim$(SaveUser.Password)
    ' Close the file.
    Close #fnum
End Sub

Private Sub cmdLogin_Click()
If txtUsername.Text = Username And txtPassword.Text = Password Then
    Unload Me
    Form2.Show
    txtUsername.Text = ""
    txtPassword.Text = ""
Else
    MsgBox "You have enterred an incorrect login", vbOKOnly + vbExclamation
    txtUsername.Text = ""
    txtPassword.Text = ""
    txtUsername.SetFocus
End If
End Sub

Private Sub cmdAdd_Click()
    ' Open the data file.
    fnum = FreeFile
    Open App.Path & "\Files\test.txt" For Random As fnum Len = Len(SaveUser)

    ' Save the records.
        SaveUser.Username = txtUsername.Text
        SaveUser.Password = txtPassword.Text
        Put #fnum, i + 1, SaveUser
    ' Close the file.
    Close #fnum
    
    MsgBox "Added"
    txtUsername.Text = ""
    txtPassword.Text = ""
    txtUsername.SetFocus
End Sub
kitchenknife is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
login system kishou Other Web Development Languages 6 Dec 14th, 2007 2:20 AM
How to use System() with multiple variables bjelleklang C 2 Dec 5th, 2006 4:33 PM
Php Login System MikeC PHP 17 Dec 17th, 2005 10:11 AM
User Input for Number Format ericelysia1 Java 0 Jul 21st, 2005 3:41 PM
How to write a login system? uman C++ 2 Jan 13th, 2005 1:33 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC