Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Visual basic


ghost's Avatar
0 0

Im make a login and im having trouble with the open "***.txt" i want it to read froma txt doc and for some reason in have a compile error i have it in the same folder and it still has an error


Mr_Cheese's Avatar
0 1

post the code you have so far and i'll be able to tell you where your going wrong.


ghost's Avatar
0 0

Dim user As String, password As String

Private Sub cmdSubmit_Click() Open "userpassw.TXT" For Input As #1 Input #1, user, password Call Login Input #1, user, password Call Login Input #1, user, password End Sub

Private Sub Login() Dim userpass As String If txtUser.Text = user Then If txtPass.Text = password Then Else Else End If End If End Sub

ya i need some help plz its not the whole code but its what i have so far..


ghost's Avatar
0 0

Dim user As String, password As String

Private Sub cmdSubmit_Click() Open "userpassw.TXT" For Input As #1 Input #1, user, password Call Login Input #1, user, password Call Login Input #1, user, password End Sub

Private Sub Login() Dim userpass As String If txtUser.Text = user Then If txtPass.Text = password Then Else Else End If End If End Sub

ya i need some help plz its not the whole code but its what i have so far..


ghost's Avatar
0 0

Well, if you're using VB.Net, I would suggest using the IO.Filestream object and a StreamReader to read from that file. If using VB6, then I think it would help more to know exactly what problem it's giving you. I'd have to say that your "nested" IF statements look rather warped if that's how they actually are in your program.

Here's a couple links that may help: http://www.aivosto.com/visdev/fso.html http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingsequentialfileaccess.asp


ghost's Avatar
0 0

If you post the kind of error you get I'll be able to help you. Is it file not found, input past end of file or what??