Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 ajax¶¯Ì¬×ÝÏò²Ëµ¥

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeftMenu.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xht ......

Asp.Net ºº×Öת»»Æ´Òô

public class chs2py
{
 public chs2py()
 {
  //
  //TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼­
  //
 }
    private static int[] pyvalue = new int[]{-20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20242,-20230,-20051,-20036,-20032,-20026,& ......

ASP.NET

Èý¡¢ÈçºÎ£ºÉèÖà ASP.NET Web ·þÎñÆ÷¿Ø¼þÊôÐÔ
      ÔÚ ASP.NET ÍøÒ³ÖУ¬¸ù¾ÝËùÐèµÄÊôÐÔ (Property) ÉèÖÿؼþÉùÃ÷µÄÊôÐÔ (Attribute)¡£
ÄúËùÉèÖõÄÈ·ÇÐÊôÐÔÈ¡¾öÓڿؼþºÍÊôÐÔ¡£ÓйØÌض¨¿Ø¼þµÄÊôÐÔµÄÐÅÏ¢£¬ÇëÔÚ“°ïÖú”Ë÷ÒýÖÐËÑË÷¸Ã¿Ø¼þÀàµÄÃû³Æ£¨ÀýÈ磬“Button Àà (System.Web.UI ......

ASP.NET

Áù¡¢ASP.NET Web ·þÎñÆ÷¿Ø¼þÖÐµÄ Tab ¼ü˳Ðò¡¢½¹µãºÍ·ÃÎʼü
      ÈôÒªÔöÇ¿ÔÚ ASP.NET ÍøÒ³ÖÐʹÓÿؼþµÄÓû§ÌåÑ飬¿ÉÒÔÖ¸¶¨Óû§Í¨¹ý°´ Tab ¼üÏÔʾ ASP.NET Web ·þÎñÆ÷¿Ø¼þµÄ˳Ðò£¬²¢¿ÉÒÔÖ¸¶¨×î³õ´ò¿ªÒ³Ê±Ò³ÉϵÄÄĸö¿Ø¼þ¾ßÓн¹µã¡£
 
1¡¢Tab ¼ü˳Ðò
µ±ÔÚä¯ÀÀÆ÷ÖÐÏÔʾҳʱ£¬Óû§¿ÉÒÔʹÓà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ