c# 生成word 文档。

string ss = o.ToString();
          Response.Expires 
= 0;
          Response.Buffer 
= true;
          Response.Clear();
          Response.ClearHeaders();
          Response.ClearContent();
          Response.AddHeader(
"Content-disposition""attachment; filename=1.doc");
          Response.ContentType 
= "application/vnd.ms-word";
          Response.Write(
"<html><head>");
          Response.Write(
"<title></title></head><body>");
          Response.Write(ss);
          Response.Write(
"</body></html>");
          Response.Flush();
          Response.End();
posted @ 2011-06-09 16:34  空紫竹  阅读(460)  评论(2编辑  收藏  举报