Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

read characters in a text file using vb

hi
i am using vb first time. please guide me anyone. i need one program in vb which should read the data in a text file by each character.so please get me the same.thank you.
nobby.a.p
[194 byte] By [nobbyap] at [2007-11-11 7:40:33]
# 1 Re: read characters in a text file using vb
Take a look at VB's Input function:
http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctinput.asp
Phil Weber at 2007-11-11 17:26:34 >
# 2 Re: read characters in a text file using vb
Hello,

Please try the stream reader class.

Dim sr as IO.Streamreader = IO.File.Opentext("JohnDoefile.txt")

then read the line

line 1 = sr.readline

Hope this helps.
boomstick425 at 2007-11-11 17:27:34 >
# 3 Re: read characters in a text file using vb
Boomstick: Questions in the FreeVBCode forums generally pertain to VB6, not .NET.
Phil Weber at 2007-11-11 17:28:35 >
# 4 Re: read characters in a text file using vb
I think he need get each character why not try this :

open "file" for binary access read as #1
get #1,,var
close #1

var contains first char ;

Inner loop will get the rest while not the file is acceed and not closed yet .
Amahdy at 2007-11-11 17:29:40 >