Question about ReadToEnd()

Legion989
11-17-2004, 09:51 PM
If i have a streamreader open and i have the following
StreamReader SRead = new StreamReader(file)

MapRows = SRead.ReadToEnd()
MapColumns = SRead.ReadToEnd()

When the program attempts to do the MapColumns read to end, does the file start at the end of the file where MapRows left off or does it start again from the beginning?

MKoslof
11-18-2004, 04:52 PM
I am somewhat confused by your question :). You are calling the same function, so both variables contain the same information. They both will read in the entire text file.

blindreaper666
11-18-2004, 05:05 PM
ReadToEnd reads all the bytes of the file. If you wanted it to read from the end of the file into a variable, what would you accomplish? It wouldn't be able to read anything. Are you trying to read certain characters into one variable and others into the other?

by_m
11-18-2004, 05:06 PM
like Mkoslof said, your question is somewhat confusing as the end of a file, is the end, there is no start at the end of anything I know of. If you use .ReadToEnd there will be nothing else to read. If you mean that stuff will get added on to the .txt file after you call .ReadToEnd the first time, then no, it should start at the beggining and read to the end as far as I know.

blindreaper666
11-18-2004, 05:21 PM
Right, like what I said, there isn't anything after the EOF, at least not in the code you've provided. Mabey it would be better for you to use substrings or a For Each statement to read to a certain point in the file, well if that is your goal. If you could re-word your question then we could give better expainations or answers. It is a little vague.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum