There can be no Triumph without Loss,No Victory without Suffering,No Freedom without Sacrifice.
All you have to decide is what to do with the time that is given to you.
Get busy Living, or Get busy Dying?
  首页 | 留言给我 | 订阅 Rss | CLI | 黄白之恋 Posts:158   Hits: 5544962    Comments: 173    
 日历归档
<<  <  2024 - 11  >  >>
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
 About Me
 Name: ZhangSichu
 Sex: Male
 Age: 32
 Email: ZhangSichu@gmail.com
 MSN: ZhangSichu@hotmail.com
 Home: ZhangSichu.com
 WeiBo: weibo.com/zhangsichu
 个人推荐
 分类归档
  ·C++/C(5)  RSS
  ·软件工程(1)  RSS
  ·杂事/随感(26)  RSS
  ·.Net/Java(30)  RSS
  ·面向对象程序设计(5)  RSS
  ·汇编/破解(0)  RSS
  ·平面设计(3)  RSS
  ·SQL(5)  RSS
  ·COM/COM+(2)  RSS
  ·Web开发(81)  RSS
 My Friends
Back Forward Refresh Home 2024年11月22日 星期五 RSS CLI Mine Sweeper. In Javascript.

  Asp.Net 直接写一个Excel文件流
字体大小 [ ]

this.Page.Response.Clear();
this.Page.Response.BufferOutput = true;
//Define Chareset
this.Page.Response.Charset = "GB2312";
//For download.
//Define type.
this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename = ExcelFile.xls");
//Define encoding.
this.Page.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
//Define Application type.
this.Page.Response.ContentType = "application/ms-Excel";

string strExcelHeader = string.Empty;
string strExcelItems = string.Empty;

//Write header;
//Please pay a ation to the character "\t"

strExcelHeader = "Column1\tColumn2\tColumn3\tColumn4\tColumn5\tColumn6\tColumn7\tColumn8\ttColumn9\t\n";

strExcelItems = "1 \t2 \t3 \t4 \t5 \t6 \t7 \t8 \t9 \t\n";
//Write Excel header.
this.Page.Response.Write(strExcelHeader);

//Write a Excel item.
this.Page.Response.Write(strExcelItems);

this.Page.Response.End();
  Posted @ 12/8/2006 11:39:16 AM | Hits (35142) | Comment (0

  Post Comment
标题 *
作者 *
密码 记住我
评论 *
    


Stable in Firefox 1.5 2.0Stable in IE6 IE7Stable in MozillaStable in Netscape
ZhangSichu.com V0.1.7507
Powered By ZhangSichu
Copyright © ZhangSichu
Download ZhangSichu.com source code. Download source code