Dynamically generated string output XML files and downloads

xiaoxiao2021-03-06  43

String str = " sdffdsfdsfd1234

Byte [] by = system.text.Encoding.default.getbytes (STR);

THIS.RESPONSE.OUTPUTSTREAM.WRITE (BY, 0, Convert.Toint32 (By.Length);

Response.charset = "GB2312";

Response.Appendheader ("Content-Disposition", "Attachment; FileName = 1.xml");

Response.ContentType = "text / xml";

Response.contentencoding = system.text.Encoding.Getencoding ("GB2312");

System.io.stringWriter TW = new system.io.stringwriter ();

System.Web.ui.htmlTextWriter HW = New System.Web.ui.htmlTextWriter (TW);

Response.write (Tw.toString ());

Tw.close ();

HW.Close ();

Response.end ();

Http://community.9cbs.net/expert/topicview.asp?id=3802270

转载请注明原文地址:https://www.9cbs.com/read-53782.html

New Post(0)