StreamReader f = new StreamReader(new FileStream("c:\afile.txt", FileMode.Open, FileAccess.ReadWrite));
char[] d = new char[????????];
f.ReadBlock (d, 0, ??????); - or maybe f.Read()?
textBox1.Text = new string(d);
All MSDN/gooogle examples talk about lines... I want read ALL text, not only one line...
How to learn the length of the text?
One thing; I would use int instead of Int32. int is an aliased type, so you will never have the potential problems of type mismatches on different platforms (256-bit CPU's? Maybe someday! )
If you liked my post go ahead and give me an upvote so that my epee.... ahem, reputation will grow.
Ahh... thinking about it (and only thinking, not actually going to the effort of actually checking), I beleive the Length property may already be Int64.
So on a 32 bit machine int is 32 bits and on a 64 bit machine int is 64 bits... Is that correct?
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
wow.. it is so easy! (must be.. I will try it now..).. so easy but so deeply hided..
thank you a lot guys..
I don not need file length in this case..
I was looking it only for char[] d = new char[__?__]; f.ReadBlock (d, 0,__?__);
Seems (to me) I must know it before file loading..
Bookmarks