asp.net responseдÎļþ
protected void Button2_Click(object sender, EventArgs e)
{
bool ok = true;
string fileName;
fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".doc";
try
{
Response.ClearHeaders();
Response.ContentType = "application/msword;";
Response.Charset = "UTF-8";
Response.AddHeader("Content-Disposition", string.Format("attachment;filename=\"{0}\"", fileName));
Response.BinaryWrite(Encoding.Default.GetBytes(strr));
}
catch (Exception ex)
{
ok = false;
Response.Write("Éú³ÉÎļþʧ°Ü£º" + ex.Message + "£¬ÇëÉÔºóÔÙÊÔ¡£");
CreateGbpt(fileName, strr);
}
if (ok)
{
Response.End();
}
}
private void CreateFile(string fileName, string text)
{
bool ok = true;
string filePath;
&
Ïà¹ØÎĵµ£º
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web ......
1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤·½Ê½(²»ÒªÃ¿´Î¶¼ÔÚ·þÎñ¶ËÑéÖ¤)¡£
6¡¢ÎªÁ˱ÜÃâÖ ......
ºÜ½üûÓÐʹÓÃ.netÁË£¬²»ÖªÊǼÇÒäÁ¦²»ÐÐÁË£¬»¹ÊÇʲôµÄ£¬iframeµÄÓ÷¨¶¼Íü¼ÇÁË£¬ÔÚÉè¼ÆurlÌø×ªtargetµÄʱºò×ÜÊDz»³É¹¦¡£ÓôÃÆÁËÎÒ£¬ÍøÉÏËÑË÷ÁËÒ»Õó»¹ÊÇûÓз¢ÏÖÊÇÔõô»ØÊ£¬ºóÀ´¸É´à¿´ÒÔǰµÄwebÒ³Ãæ£¬ÕÒÁ˺þã¬ÖÕÓÚÕÒµ½£¬ÔÀ´ÔÚÉè¼ÆiframeµÄʱºò£¬²»½öÐèÒªid£¬¸üÐèÒªnameÊôÐÔ£¬¶øvsÖÐÌṩµÄiframeÊôÐÔûÓÐname,ËùÒÔº¦ÎÒæ»îÁ ......
ʹÓÃvs 2005,·¢ÏÖ¸ù±¾´ò²»¿ªÀÏʦ·¢¹ýÀ´µÄÔ´´úÂëPortal_Article.csprojÎļþ,ÉÏÍø²éÁËÒ»ÏÂ,ºÃ¶àÈ˶¼ËµÊÇÊÇÒòΪûÓиøvs
2005´ò²¹¶¡.ÎÒµÄн¨ÏîÄ¿Àï¸ù±¾Ã»ÓÐASP.NET WEBÓ¦ÓóÌÐò,¾¹ýÒ»¸öÏÂÎçµÄŬÁ¦,ÖÕÓÚ×ܽá³öÁË,½â¾öÎÊÌâµÄ·½·¨.
1.ÏÈ´Ó΢ÈíÍøÕ¾ÏÂÔØ²¹¶¡.
ÏÂÔØµØÖ·1Ϊ£ºhttp://download.microso ......