![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2008
Posts: 5
Rep Power: 0
![]() |
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 |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |