Re: Reading in a textfile?
- From: "rowe_newsgroups" <rowe_email@xxxxxxxxx>
- Date: 1 Mar 2007 10:10:30 -0800
On Mar 1, 12:48 pm, "Ron" <pts4...@xxxxxxxxx> wrote:
Hello everyone,
I've created a functioning ATM program, a bank machine.
Now I want to implement usernames and Pins into it. So I have a text
file with this info.
BILL, 1111
TOM, 2222
CHRIS, 3333
How do I go about reading those values from a text file into arrays
and then access those arrays?
Look up filestream.
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>
Then use something like this to validate users
'Imports System.Xml assumed
private function IsValid(userName as string, userPin as string)
Dim doc as XmlDocument
doc.Load("MyXmlFilePath.Xml")
Dim node as XmlNode = doc.GetElementsByTagName(userName)(0)
if node.Attributes("pin").Value = userPin then
return True
else
return false
end if
end function
Thanks,
Seth Rowe
.
- Follow-Ups:
- Re: Reading in a textfile?
- From: \(O\)enone
- Re: Reading in a textfile?
- References:
- Reading in a textfile?
- From: Ron
- Reading in a textfile?
- Prev by Date: How to convert a stream to a string?
- Next by Date: Re: Where is Sub New
- Previous by thread: Reading in a textfile?
- Next by thread: Re: Reading in a textfile?
- Index(es):
Relevant Pages
|