471,318 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

How to read and write a list of variables to a file?

Hi

How do you read and write some variables to a file in .net. I couldn't find
a stream reader overide similar to vb6 Write # and Input # statements

Julian
Jul 21 '05 #1
2 990
pass the stream into a TextWriter or XmlTextWriter

"Julian" <ju****@kt88.freeserve.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hi

How do you read and write some variables to a file in .net. I couldn't
find
a stream reader overide similar to vb6 Write # and Input # statements

Julian

Jul 21 '05 #2
Stream fStream = new FileStream("filename");
TextWriter writer = new TextWriter(fStream);

writer.WriteLine(variable);
....
....

writer.Close();
fStream.Close();

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------------------------

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by jas | last post: by
1 post views Thread by vkrasner | last post: by
6 posts views Thread by Samuel M. Smith | last post: by
6 posts views Thread by Per Juul Larsen | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.