Jump to content

Visual Basic 6 help


Trade_With

Recommended Posts

Basically I need to a login system for the project i'm doing.

 

 

 

 

 

 

 

It will need to take in a new username and password and store them in an external file.

 

 

 

 

 

 

 

Then for logging in it would take the values of the text boxes and match them with the names and passwords in the external file, if they match it logs in, if not the user has to re-enter.

 

 

 

 

 

 

 

I need some help for the code for this, i've searched around various Vb specific forums etc. But none of them do exacly what I need.

 

 

 

 

 

 

 

 

 

 

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Crap.. I did something like that last year in my C++ class, but I forgot the exact code.

 

 

 

 

 

 

 

I'll get back to you if I figure it out, shouldn't be too hard though I'd think. As long as you know the command to send something to a text document the putting it in part will be easy. Getting it out will be harder.

 

 

 

 

 

 

 

Is this just an all text program or actual GUI btw? I'm thinking its the former.

Link to comment
Share on other sites

I'm not going to give you code but here's a cheaply done description on how to do it.

 

 

 

 

 

 

 

First, append the username and password into a string seperated by the seperator you'll be using in the file if you are using one. Next, open the file for reading. Next, instr() the file for the user/pass combo. Next, close the file.

 

 

 

 

 

 

 

What I mean by append the username and password into a string seperated by the seperator is:

 

 

 




dim strBlah as string



strBlah$ = username & ":" & password



 

 

 

 

 

 

 

That'd obviously be using : as a seperator, so in the external file all usernames and passwords would look like username:password

 

 

 

 

 

 

 

 

 

 

 

Another way you could do it if you want 2 seperate files for the passwords and usernames is to use 2 arrays to load the usernames and passwords then check to make sure the indexes of the arrays are a match as the username and password.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.