Computing.Net > Forums > Programming > Reading in VB6

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Reading in VB6

Reply to Message Icon

Name: Duncan
Date: August 21, 2003 at 12:07:38 Pacific
OS: Windows Xp Pro
CPU/Ram: 3.0 HT/2 GB
Comment:

I am looking to load a .txt file that would have all the users and pw that were created, well trying to log in, it goes through the file finds the name then checks to see if the PW matches the Username. Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: micah
Date: August 21, 2003 at 12:14:20 Pacific
Reply:

What exactly are you having problems with? Loading the file? Parsing it?

-Micah


0

Response Number 2
Name: Dunca
Date: August 21, 2003 at 12:43:34 Pacific
Reply:

Parsing it, I have the file and it is created but I need to parse it so that it splits into Username and the PW then compares them.


0

Response Number 3
Name: Infinite Recursion
Date: August 21, 2003 at 17:34:00 Pacific
Reply:

Duncan,

Have you looked into reading each login entry of the file into a string and using the the Split function to extract username and password into their own variables, then compare the two as needed? The split function depends on how your login entries are delimited.

Infinite Recursion



0

Response Number 4
Name: Duncan
Date: August 21, 2003 at 18:49:22 Pacific
Reply:

I don't know how to use the split function, do you know where I could find a tutorial or could you show me how on here, you can email me at dbgrazier@snet if you know how thanks.


0

Response Number 5
Name: Infinite Recursion
Date: August 21, 2003 at 19:46:50 Pacific
Reply:


Dim str() as string

'str' is a string containing a line of your login file... You can split the input string based off of a Carriage Return and Line Feed delimeter.

The code below shows this and just displays the results inside of a message box. You can use a while loop and do this for all files, acting / comparing on the segments of str as needed...

-------
content = Spilt(str,vbCrLf)
For i = LBound(str) to UBound(str)
Msgbox str(i)
Next i
-------

Infinite Recursion


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Design and Programming co... C++/..etc help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Reading in VB6

How To Read/Write File in VB6 www.computing.net/answers/programming/how-to-readwrite-file-in-vb6/7105.html

One line of a .txt file in VB6 www.computing.net/answers/programming/one-line-of-a-txt-file-in-vb6/8248.html

reading in a file www.computing.net/answers/programming/reading-in-a-file/13112.html