hey guys, i have a prg that writes a flat text file with specific (spacing) whitespace between the elements.
that works fine.

but i was curious: when i use streamReader to read that back and say put into a listbox, the spacing (formatting) goes away.
does anyone have any insight on how to keep the formatting on this?
here's how im reading it.

Dim sr As New StreamReader("C:\MyFile.text")
Dim line As String
line = ""
Try
While (sr.Peek > -1)
line = sr.ReadLine
lstOne.Items.Add(line)
End While
Finally
sr.Close()
End Try

thanks again
rik


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Re: StreamWriter/StreamReader by Kevin

Kevin
Sun May 29 15:15:31 CDT 2005

Hi Rik

Could you post a sample of your text file?
I'm not sure I understand how the formatting goes away!

-Kevin

>hey guys, i have a prg that writes a flat text file with specific (spacing) whitespace >between the elements.
>that works fine.


>but i was curious: when i use streamReader to read that back and say put into a listbox, >the spacing (formatting) goes away.
>does anyone have any insight on how to keep the formatting on this?
>here's how im reading it.


>Dim sr As New StreamReader("C:\MyFile.text")
>Dim line As String
>line = ""
>Try
>While (sr.Peek > -1)
>line = sr.ReadLine
>lstOne.Items.Add(line)
>End While
>Finally
>sr.Close()
>End Try


>thanks again
>rik