The problem is when registering a new user.
What I'm doing is, I make a new .txt file for each user with on the first line the user name and the second line the password.
The problem is, when the file is created and the data is stored it is stored with the annoying little @#$&*: "..."
So then when it reads from the text file it reads the ".."
Eg.
When user enters his password as: ABCD
The program compares it to the file which has: "ABCD"
therefore the user is denied access.
My question: How do I get rid of the "..."
Thanks in advance.
I think the problem is really in the last 5 lines.
RegUNam, RegPass are dimmed as String
Expand|Select|Wrap|Line Numbers
- Register_Name:
- RegUNam = InputBox("Enter desired username", "Username")
- If RegUNam = "" Then
- Response = MsgBox("Do you wish to try again?", vbYesNo, "Username")
- If Response = vbYes Then GoTo Register_Name
- If Response = vbNo Then Exit Sub
- End If
- RegPass = InputBox("Enter password", "Password")
- If RegPass = "" Then
- Response = MsgBox("Do you wish to try again?", vbYesNo, "Username")
- If Response = vbYes Then GoTo Register_Name
- If Response = vbNo Then Exit Sub
- End If
- Open "E:\Multimedia\Documents\Marco\SDD\Assignment\Users\" & MyName & ".txt" For Output As #2
- Write #2, RegUNam
- Write #2, RegPass
- Close #2
- MsgBox "User created."
- Exit Sub
Is it possible to replace that to something that finds the directory all the files are stored in? Because the file is saved on a USB stick and therefore the drive changes.. and also it is being installed on different computers.
*The project is saved in this folder and the user in this folder\Users\
THANK YOU FOR HAVING A LOOK!!