Re: reading from a stream

Greg Reinacker <[email protected]> Sun, 23 Jun 2002 09:37:28 -0600
Newsgroups gmane.comp.windows.devel.dotnet.general
Message-ID <000001c21acb$e19aff70$6401a8c0@rassoc2>
Use a StreamReader object.  Here's an example for reading the entire
contents of a file into a string.

   StreamReader sr = new StreamReader(@"c:\myfile.txt");
   string s = sr.ReadToEnd();
   sr.Close();

Greg Reinacker
Reinacker & Associates, Inc.
http://www.rassoc.com
http://www.rassoc.com/gregr/weblog/

-----Original Message-----
From: The DOTNET list will be retired 7/1/02
[mailto:[email protected]] On Behalf Of george antony
Sent: Sunday, June 23, 2002 9:01 AM
To: [email protected]
Subject: reading from a stream


hi all
I have a openfile dialog box. I have to open a file
and assign the contents of a file to a textbox.
when i use the openfile() method of a openfiledialog
it gives me a stream object. how to read from stream
and assign to textbox.


regards
george

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.