hey everybody! :D
I am a major noob at programming and I am using VB '08 Express and want to use a text file to set variables on seperate forms of one program. What I would like to know is if i should use seperate files for each form and how to structure the text file and load it into seperate variables.

(text file)
User1 Info1, User1 Info2, User1 Info3, User1 Info4, etc.
User2 Info1, User2 Info2, User2 Info3, User2 Info4, etc.

(form code)
User1 Info1 = value1
User2 Info1 = value2

Is this even possible in VB? I have been reading posts for two days and it looks like its possible but not easy.

Any help is MUCH appreciated..

P.S. everything else is working good... just want this so i can edit the login without recoding.

8 Years
Discussion Span
Last Post by blackknight469

I think it's possible to take values from file.TXT
btw, i'm using VB 2005, i don't know it is work for vb 2008 or not.

I take value per line from file.txt using an arraylist.

dim array as new arraylist

'open file.txt n allow file.txt to be read
dim file as new filestream ("[your file address], filemode.open, fileaccess.read")

'reading file.txt
dim sr as streamreader(file)

'inserting file.txt value to an array
while (sr.peek > -1)
      array.add (sr.readline)       'read value per line 
end while

'don't forget close the file.txt 

'see file.txt value 1st line

for example:
file.txt calling value
line 1 : info1 array(0)
line 2 : info2 array(1)

i hope this help U...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.