Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / VB / VB.net - Saving loin usernames and passwords to a file

Author
Message
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Nov 2009 05:24
im new to Visual BASIC, and so i need to know how to save a list of login usernames and their corresponding passwords to a file, and retrieve from this file when the program is run

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Nov 2009 00:43 Edited at: 16th Nov 2009 00:44
I don't have a specific username for my loin

VB or VB.net?
If it's .net, have a look at the System.IO namespace. The System.IO.File class has methods to access files.

That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th Nov 2009 16:58
nope, plain VB

and i think im going to eleiminate the usernames and just have a four digit passcode, its only going to need to hold about 10 codes

i know theres a way to use a list box or something similar to hold this data, but idk how to access and check each individual piece of data

That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th Nov 2009 17:21
Ok i finally figured out how to access a specific data member of a list [Listname.List(data number)], but i still need to know how i can write these data members to a file along with their associated names

JRH
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Stirling, UK
Posted: 29th Nov 2009 00:37 Edited at: 29th Nov 2009 00:38
Which version of VB. If .Net, I'd use this (assuming that all user names and passwords are stored in a single list box):

Write list to file:


Read file back to list box


Put this before your class


Hope that helped

JRH
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Stirling, UK
Posted: 29th Nov 2009 00:40
Just noticed it was plain VB. Which version? This is a lot more cumbersome.

That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th Dec 2009 20:15
UMMMMM i have no idea which version, its the schools so idk.

but i figured it out with a little googling, just used OPEN FOR INPUT and OPEN FOR OUTPUT along with PRINT

thanks for the help though!

Login to post a reply

Server time is: 2026-06-10 05:53:33
Your offset time is: 2026-06-10 05:53:33