ASP.NET 2.0 ÎļþÏÂÔØ£¨Ö§³Ö´óÎļþ¡¢·ÀµÁÁ´£©
1.ÎļþÏÂÔØ
HTTP ÎļþÏÂÔØÖ÷ÒªÓÐÁ½ÖÖ·½Ê½£º
URL·½Ê½Ö±½ÓÏÂÔØ£¬ÓŵãÊÇ£ºÕ¼Ó÷þÎñÆ÷×ÊÔ´ÉÙ£¬Ëٶȿ죻ȱµãÊÇ£º ²»ÄÜ׼ȷ¼ÆÁ¿ÏÂÔØ´ÎÊý£¬ÎÞ·¨·ÀÖ¹µÁÁ´£¬±£´æÔÚÊý¾Ý¿âÖеÄÎļþÎÞ·¨ÏÂÔØ£¬³£¼û¸ñʽµÄÎļþÈç.html Ö±½ÓÔÚä¯ÀÀÆ÷Öдò¿ª£¬²»ÄÜÖ±½ÓÏÂÔØ¡£
¶þ½øÖÆÊý¾ÝÁ÷Êä³ö·½Ê½£¬ÓŵãÊÇ£º×¼È·¼ÆÁ¿ÏÂÔØ´ÎÊý¡¢ÄÜ·ÀµÁÁ´¡¢ËùÓÐÎļþ¸ñʽ¶¼ÄÜÖ±½ÓÏÂÔضø²»ÊÇ´ò¿ª¡¢±£´æÔÚÊý¾Ý¿âÖеȷÇÎļþÊý¾ÝÄÜÒÔÎļþ·½Ê½ÏÂÔصȣ»È±µãÊÇÕ¼Ó÷þÎñÆ÷×ÊÔ´¶à¡£
´óÎļþÏÂÔØÔÀíÊÇ°ÑÎļþÇгÉС¶ÎÊý¾ÝÁ÷ÏÂÔØ£¬Î¢Èímsdn¸ø³öÁË´óÎļþÏÂÔصÄʾÀý£¬µ«´æÔÚÖÐÎÄÎļþÃûÂÒÂëÎÊÌ⣬ÉԼӸĶ¯¼´¿É¡£´úÂëΪ£º
protected void ResponseFile(string path)
{
System.IO.Stream iStream = null;
byte[] buffer = new Byte[10000];
int length;
long dataToRead;
string filename = System.IO.Path.GetFileName(path);
try
{
iStream= new System.IO.FileStream(path, System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read);
dataToRead= iStream.Length;
Response.ContentType= "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" +
HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8));
while (dataToRead > 0)
{
if (Response.IsClientConnected)
{
length= iStream.Read(buffer, 0, 10000);
Response.OutputStream.Write(buffer,0, length);
Response.Flush();
buffer = new Byte[10000];
dataToRead= dataToRead - length;
}
else
{
dataToRead= -1;
}
}
}
catch (Exception ex)
{
Response.Write("ÎļþÏÂÔØʱ³öÏÖ´íÎó!");
}
finally
{
if (iStream != null)
{
iStream.Close();
}
}
}
2.·ÀÖ¹µÁÁ´
protected void Page_Load(object sender, EventArgs e)
{
/*--------------------------------------------------------------*\
* ´óÎļþÏÂÔØ£¬·ÀµÁÁ´ *
* *
* tda7264@163.com *
* *
* Æ
Ïà¹ØÎĵµ£º
Asp.net ÓÃurlÖØд(URLReWriter)ʵÏÖÈÎÒâ¶þ¼¶ÓòÃû
ÎÒ×î½üдÁ˸öСÀý×Ó,´ó¼Ò¿ÉÒÔÏÈ¿´Õâ¸ö,ÀïÃæÓÐСÀý×ÓµÄÍêÕû´úÂëÏÂÔØ.
http://www.cnblogs.com/notus/archive/2009/03/26/1422548.html
ºÃ¾ÃûÓÐд¼¼ÊõÎÄÕÂ,Èç¹û´ó¼Ò¿´²»Ã÷°×,¾Í¶à¿´¼¸Æª,º¹,»òÕß,ÔÚÎÄÕµĺóÃæ»Ø¸´(ÕâÊÇ×îÓÐЧµÄ°ì·¨),ÎһᾡÁ¦°ïÖú´ó¼Ò½â´ðÒÉ»ó.
À´ ......
AtlasÊÇʲô£¿
atlas 2006-12-12 09:48 ÔĶÁ69 ÆÀÂÛ0
×ֺţº ´ó´ó ÖÐÖРСС
AtlasÊÇʲô£¿
ASP.NET”Atlas”ÊÇÒ»¸öеÄWeb¼¼Êõ¿ª·¢°ü£¬Ëü¼¯³ÉÁËÒ»Ì׷dz£´óµÄ¿Í»§¶Ë½Å±¾¿âʹµÃÓ빦ÄܷḻµÄ¡¢»ùÓÚ·þÎñÆ÷¿ª·¢Æ½Ì¨µÄASP.NET2.0½áºÏÔÚÒ»Æð£¬&rdq ......
Èý¡¢ÈçºÎ£ºÉèÖà ASP.NET Web ·þÎñÆ÷¿Ø¼þÊôÐÔ
ÔÚ ASP.NET ÍøÒ³ÖУ¬¸ù¾ÝËùÐèµÄÊôÐÔ (Property) ÉèÖÿؼþÉùÃ÷µÄÊôÐÔ (Attribute)¡£
ÄúËùÉèÖõÄÈ·ÇÐÊôÐÔÈ¡¾öÓڿؼþºÍÊôÐÔ¡£ÓйØÌض¨¿Ø¼þµÄÊôÐÔµÄÐÅÏ¢£¬ÇëÔÚ“°ïÖú”Ë÷ÒýÖÐËÑË÷¸Ã¿Ø¼þÀàµÄÃû³Æ£¨ÀýÈ磬“Button Àà (System.Web.UI ......
ÔÚASP.NET ÖÐʵÏÖµ¥µãµÇ¼
³ö×Ô£º¡¾ÃÏÏÜ»áÖ®¾«²ÊÊÀ½ç¡¿ ·¢²¼ÈÕÆÚ£º2005Äê1ÔÂ27ÈÕ 8µã48·Ö0Ãë
ÓÉÓÚijЩÔÒò£¬ÔÚÎÒÃǵÄÓ¦ÓÃÖлáÓöµ½Ò»¸öÓû§Ö»ÄÜÔÚÒ»¸öµØ·½µÇ¼µÄÇé¿ö£¬Ò²¾ÍÊÇÎÒÃÇͨ³£Ëù˵µÄµ¥µãµÇ¼¡£ÔÚASP.NETÖÐʵÏÖµ¥µãµÇ¼ÆäʵºÜ¼òµ¥£¬ÏÂÃæ¾Í°ÑÖ÷ÒªµÄ·½·¨ºÍÈ«²¿´úÂë½øÐзÖÎö¡£
ʵÏÖ˼·
ÀûÓÃCacheµÄ¹¦ÄÜ ......