asp ÖÐÊý¾Ýµ¼³öΪ word £¬excl £¬text £¬µÈ¸ñʽÎļþ
ÕâÊÇ´Ó·½·¨Ö±½Ó¸´ÖƵģ¬
²ÎÊý fileTypeÊÇÎļþ¸ñʽ
²ÎÊýfiledNameÊÇд³öºóÎļþµÄÎļþÃû¡£
²ÎÊýsuffixÊÇд³öºóÎļþµÄÎļþºó׺Ãû¡£
Response.Clear(); //Çå¿Õ »º³åÇøµÄËùÓÐÊä³öÊý¾Ý
Response.Charset = "utf-8";//ÉèÖÃÊä³öÊä³öÁ÷×Ö·ûÀàÐÍ
Response.ContentType = fileType;ÉèÖÃÊä³öÁ÷µÄ file MIMEÀàÐÍ
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName) + suffix);//½«HTTP Í·Ìí¼Óµ½Êä³öÁ÷£¬“+”ÒÔǰÊǹ̶¨µÄ ×Ö·û´®Á¬½ÓÊÇΪÁËдÎļþÃûºÍÎļþºó׺Ãû
Response.Write("<html><head><Meta http-equiv=\"Content-Type\"content=\"text/html;charset=utf-8\"></head><body>");
Response.Write("<h1>"+article.Title+"</h1><p/>"+article.Context);
Response.Write("</body></html>");
//ÎļþÄÚÈÝ
Response.End();
//¹Ø±Õ
µ±µ¼³öµÄÎļþΪ Îı¾¸ñʽʱ Response.Write(" ")ÖоͲ»±ØÐ´ÈëHTML´úÂ룬Èç¹ûдÈëÁË£¬Îı¾ÄÚÈÝ»á³öÏÖ HTML
Response.ContentType ="application/ms-excel";ÊÇexcel
Response.ContentType ="Content-Disposition";ÊÇword
Ïà¹ØÎĵµ£º
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
HTML:µ±È»ÕâÊÇÍøÒ³×î»ù±¾µÄÓïÑÔ,ÿһ¸ö·þÎñÆ÷ÓïÑÔ¶¼ÐèÒªËüµÄÖ§³Ö,Ҫѧϰ,Õâ¸ö¿Ï¶¨ÊÇ¿ªÊ¼ ......
ÍøÒ³ÖÆ×÷ÖУ¬ÎªÁË·½±ãÈÕºóÐ޸ĻòÐ×÷¿ª·¢£¬³£³£Òª¶ÔÒ³Ãæ½øÐÐÏàÓ¦µÄ×¢ÊÍ£¬ÄãÍøÒ³½á¹¹ÇåÎú£¬¿É¶ÁÐÔÔöÇ¿¡£ÒÔϽéÉܼ¸ÖÖ³£ÓõÄ×¢ÊÍ·½·¨£º
Ò»¡¢HTMLµÄ×¢ÊÍ·½·¨
<!-- html×¢ÊÍ:START -->
ÄÚÈÝ
<!-- html×¢ÊÍ:END -->
¶þ¡¢CSSµÄ×¢ÊÍ·½·¨
<style type="text/css">
/* css×¢ÊÍ*/
</style>
ÔÚµ¥¶À ......
ASP£¨Active Server Pages£©ÊÇMicrosoftºÜÔç¾ÍÍÆ³öµÄÒ»ÖÖWEBÓ¦ÓóÌÐò½â¾ö·½°¸£¬Ò²ÊǾø´ó¶àÊý´ÓÊÂÍøÕ¾¿ª·¢ÈËÔ±ºÜÊìϤµÄÒ»¸ö±È½Ï¼òµ¥µÄ±à³Ì»·¾³¡£Í¨¹ýASPÎÒÃÇ¿ÉÒÔ´´½¨¹¦ÄÜÇ¿´óµÄ¶¯Ì¬µÄWEBÓ¦ÓóÌÐò¡£ASPËäÈ»¹¦ÄܺÜÇ¿´ó£¬µ«ÓÐЩ¹¦ÄÜÓô¿ASP´úÂëÍê³É²»ÁË£¬ÎªÁËÄܱ£Ö¤¿ª·¢³ö¹¦Äܸü¼ÓÇ¿´óµÄWEBÓ¦ÓóÌÐò£¬ÎÒÃÇ¿ÉÒÔ½èÖúµ÷ÓÃCOM×é¼þ¡£ ......
ÔÚInterDevÖÐʵÏÖÍøÉϹºÎïÍÆ³µ(1)
¡¡±¾ÎĽ«½éÉÜÔÚInterDevÖÐʵÏÖÍøÉÏÉ̵깺Îï³µ¹¦Äܵķ½·¨£¬¾ßÌå²½ÖèÈçÏ£º
¡¡¡¡Ò»¡¢ Êý¾Ý¿â½á¹¹£º
¡¡¡¡²úÆ·Êý¾Ý±í(Products): ´æ·Å²úÆ·ÐÅÏ¢
²úÆ·Ãû ProductName
²úÆ·±àºÅ ProductID
µ¥¼Û Price
·ÖÀà±àºÅ CategoryID
¡¡¡¡ Cart£º¹ºÎï³µÊý¾Ý±í£¬ÁÙʱ´æ·Å¿Í»§µÄ¶ ......