Read Text File into array w/ ce 5.0 Application

R

RW

Hello. I've been working w/ vb 6.0 for sometime now and have moved up
to VS 2005 to create a application for a Windows CE 5.0 hand held
device. I thought the transition would be easy, however the language
is quite a bit different from vb6. So here's a snippet of code that I
would use in vb6 to read a text file line by line into an array.
Could someone point me in the right direction on how to do this in
Vb2005 for a Ce App? Thanks, RW

dim linenum as double
dim strfileline(1 to 500) as string

Open "myfile.txt" For Input As #iFileNr

linenum = 1

Do until eof(iFileNr)
Line Input #iFileNr, strfileline(linenum)
linenum = linenum + 1
Loop
 
G

Guest

I use this:

dim strfileline as string()
strfileline = File.ReadAllLines("myfile.txt")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top