By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,101 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,101 IT Pros & Developers. It's quick & easy.

Login System (Need help with problem)

P: 42
Hi.

I know what im doing wrong but i dont know how to fix it.

I have the follow code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.     If Text2.Text = App.Path & "\members\" & Text1.Text & "\password.txt" Then
  3. MainForm.Show
  4. LoginForm.Hide
  5. Else
  6. MsgBox "Please check your Username/Pass.", vbCritical, "Wrong Login!"
  7. End If
  8. End Sub
I know that it now just looks at the path. But i need it to read the INSIDE of the txt file. How would i manage that?
Apr 6 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
The quick and simple way to read a text file is by using the Open command. For example...
Expand|Select|Wrap|Line Numbers
  1. Open "Text.txt" For Input Access Read Shared As #1
  2. Line Input #1, MyString
  3. Close #1
If you want much better capabilities, look into the FileSystemObject, but it's a little more complex to use.
Apr 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.