|
-
Apr 20th, 2000, 08:13 PM
#1
Thread Starter
Lively Member
I am trying to have a password that the user enters before my program. I have already created a file called C:\password1.txt
The problem is that when I let the user change their existing password and enter a new one, the program just stops running and no error messages come up. I then have to click on the stop button.
Here is my code: (there's probably a stupid erroro in there somewhere but I can't find it!)Private Sub Command1_Click()
Open "C:\password1.txt" For Input As #1
Line Input #1, A$
If txtOldpassword.Text = A$ Then
'Close #1
Open "C:\password1.txt" For Output As #1
Print #1, txtNewpass.Text
Close #1
Load MainMenu
MainMenu.Show
Unload Changepassword
Else
MsgBox ("Wrong password entered")
Close #1
End If
End Sub
Can anyone help?
Cheers
brjames
-
Apr 20th, 2000, 09:07 PM
#2
Junior Member
you could try putting the new password into a string and using that to write to the file eg.
a$=newpassword.text
print #1,a$
also it looks like you have a ' before the first close #1 take it out and it should work
-
Apr 20th, 2000, 09:09 PM
#3
Junior Member
also try using
input #1,a$
not line input
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|