write file in buffer

R

Rahul

I want to create/write XML file using streamwriter or something in buffer
and redirect it to client without storing it on the server's harddisk in
ASP.NET 2.0

Rahul
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Rahul said:
I want to create/write XML file using streamwriter or something in buffer
and redirect it to client without storing it on the server's harddisk in
ASP.NET 2.0

Rahul

You have many options. You can use a StringBuilder directly to put the
string together, you can use a StringBuilder as temporary storage and a
StringWriter to write to it, or you can use a MemoryStream as temporary
storage and use a StreamWriter or an XmlTextWriter to write to it.

If you use a MemoryStream as temporary storage, you have to reset it and
read from it again to get the text as a string, while you can get a
string directly from a StringBuilder. On the other hand, the
XmlTextWriter may be handy for creating the XML.

If you use a writer, rememeber to flush it before getting the string.

/Göran Andersson
___
http://www.guffa.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top