Discussion:
Response.BinaryWrite後 網頁變亂碼
(时间太久无法回复)
ad
2006-04-29 20:54:11 UTC
Permalink
€p§ÌŠ³€@­ÓWeb Application ¥Î€U­±ªºµ{Š¡, ±N€@­ÓExcelÀÉ,°ešìClientºÝ
ŠýExcelÀÉ°e¥X«á, §Ú¥hÂI¿ï³oWeb applicationªºšä¥Šºô­¶, ºô­¶ªº€º®e³£ÅÜŠš¶ÃœX(€£¬O°e¥X¥hªºExcelÀÉÅܶÜX)

œÐ°Ý§Ú­nŠpŠó³B²z©O?


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static void SendXlsToClient(Page MyPage, MemoryStream ms)
{
ms.Position = 0;
MyPage.Response.Clear();
MyPage.Response.AddHeader("Content-Disposition", "attachment;
filename=Test.xls");
MyPage.Response.AddHeader("Content-Length", ms.Length.ToString());
MyPage.Response.ContentType = "application/excel"; //octet-stream";
MyPage.Response.BinaryWrite(ms.GetBuffer());
MyPage.Response.End();
}
璉璉
2006-04-30 02:09:01 UTC
Permalink
§Ašä¥Lºô­¶Š³Šb­¶­º¿é¥XœsœX€èŠ¡¶Ü¡G
ex.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
©ó news:eCjQd88aGHA.3992%40TK2MSFTNGP05.phx.gbl µoªí
ŠýExcelÀÉ°e¥X«á, §Ú¥hÂI¿ï³oWeb applicationªºšä¥Šºô­¶, ºô­¶ªº€º®e³£ÅÜŠš¶ÃœX(€£¬O°e¥X¥hªºExcelÀÉÅܶÜX)
œÐ°Ý§Ú­nŠpŠó³B²z©O?
--
€ô®ü¬ì§Þšt²Î¬ãµoÅçÃÒ€u§@«Ç ASP.NET Web News Reader 0.2.0 UTF-8 Beta
·s»Džs²Õ RSSºô»xµo¥¬ŽúžÕ€€ http://tlcheng.no-ip.com/News/rss2.aspx
ºô¯žŠa¹Ï http://tlcheng.no-ip.com/wwwmap.htm
¬y°ìšŸ¬x/°Ï°ì€ôžê·œ/®}ª@ºô/ªŽºÀ¹Ï/»y­µ³q°T €å³¹»Pµ{Š¡
Basic/Fortran/Windows API/.Net/»²§U»¡©úÀÉ ­ì©lœX¡B€å³¹»P°Qœ×
--
ASPNET News http://tlcheng.no-ip.com/News/ | http://tlcheng.twbbs.org/News/
RSS 2.0 http://tlcheng.no-ip.com/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.aspnet
Loading...