Re: Reading in a textfile?
- From: "\(O\)enone" <oenone@xxxxxxxxxxx>
- Date: Thu, 01 Mar 2007 18:49:23 GMT
rowe_newsgroups wrote:
Look up filestream.
Or if you're using VB2005, look up System.IO.File.ReadAllLines, which will
read each line of a text file into separate elements of a string array, all
in just one line of code. Lovely. :)
Also, I would highly suggest using a Xml file instead of just a text
file.
Something like:
<Accounts>
<Users>
<Bill pin="1111" />
<Tom pin="2222" />
<Chris pin="3333" />
</User>
</Accounts>
....although if you do use XML, I'd structure it more like this:
<Accounts>
<Users>
<User name="Bill" pin="1111" />
<User name="Tom" pin="2222" />
<User name="Chris" pin="3333" />
</Users>
</Accounts>
....or like this:
<Accounts>
<Users>
<User>
<Name>Bill</Name>
<Pin>1111</Pin>
</User>
<User>
<Name>Tom</Name>
<Pin>2222</Pin>
</User>
<User>
<Name>Chris</Name>
<Pin>3333</Pin>
</User>
</Users>
</Accounts>
....XML has some strict rules about the naming of elements, and you don't
want to get to the end of your project and find that you can't store names
with spaces in, or with apostrophes such as in "O'Brien".
You might also want to consider encryption of the PINs...
--
(O)enone
.
- References:
- Reading in a textfile?
- From: Ron
- Re: Reading in a textfile?
- From: rowe_newsgroups
- Reading in a textfile?
- Prev by Date: Re: No Delete or Update Commands
- Next by Date: Re: How to convert a stream to a string?
- Previous by thread: Re: Reading in a textfile?
- Next by thread: Re: Reading in a textfile?
- Index(es):