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

asp.net ÓÃÁ÷µÄ·½Ê½ÏÂÔØÎļþ

//ÒÔÏ´úÂë¸ù¾Ý±ðÈËÎÄÕºÍ×Ô¼ºÕûÀí
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace WebApplication1
{
public partial class DownfFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
/// <summary>
/// WriteFileÏÂÔØ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button1_Click(object sender, EventArgs e)
{
string name ="DreamweaverCS3¼òÌåÖÐÎÄÃ⼤»îÂÌÉ«°æ.rar";
string path =Server.MapPath("DreamweaverCS3¼òÌåÖÐÎÄÃ⼤»îÂÌÉ«°æ.rar");
FileInfo fileinfo = new FileInfo(path);
long size = fileinfo.Length;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + name);
Response.AppendHeader("Content-Length", size.ToString());
Response.AppendHeader("Content-Transfer-Encoding", "binary");
Response.ContentEncoding = System.Text.Encoding.UTF8;//GetEncoding("gb2312");
Response.WriteFile(path,0,size);
Response.Flush();
Response.End();
}
/// <summary>
/// ʹÓÃOutputStream.Write·Ö¿éÏÂÔØÎļþ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

protected void Button2_Click(object sender, EventArgs e)
{
string fileName = HttpContext.Current.Server.UrlEncode("DreamweaverCS3¼òÌåÖÐÎÄÃ⼤»îÂÌÉ«°æ.rar");
string filePath = HttpContext.Current.Server.MapPath("DreamweaverCS3¼òÌåÖÐÎÄÃ⼤»îÂÌÉ«°æ.rar");
//Èç¹ûҪдÀàµÄ»°ÓÃHttpResponse h


Ïà¹ØÎĵµ£º

asp.net ÉèÖóö´íÒ³

    <system.web> 
      <!--********³ö´íÒ³µÄÉ趨********-->
    <customErrors mode="On" defaultRedirect="~/Error.htm"> </customErrors> ......

ASP.NET»ñÈ¡·þÎñÆ÷ÐÅÏ¢

"·þÎñÆ÷Ãû³Æ£º"+Server.MachineName;//·þÎñÆ÷Ãû³Æ 
                  "·þÎñÆ÷IPµØÖ·£º" + Request.ServerVariables["LOCAL_ADDR"];//·þÎñÆ÷IPµØÖ· 
          &nbs ......

Asp.Net C#ÖÐSession ÈçºÎ´¢´æÈ¡ÐÅÏ¢

ÒòΪ¸Õ¸Õ½Ó´¥C#ÓïÑÔ²»¾Ã,ÓÚÊÇÎÒ°Ñ¿ØÖÆÌ¨¸øÈÓÁË,ÒòΪÎÒÌÖÑá¿ØÖÆÌ¨!
¶øÊÂʵÉÏÎÒÖ»¶ÔWinForm¼¼Êõ¸ÐÐËȤ,µ«ÊÂʵÉϵ½ÏÖÔÚÎÒ·¢ÏÖASP.Net C#µÄWeb¼¼ÊõÊÇÈÕÏÔÖØÒªÆðÀ´!
ÓÚÊÇ¿ªÊ¼½Ó´¥,¸Õ¸ÕÆð²½ÓÚËùÖª,ÓÈÆäÊÇһЩ×î¼òµ¥µÄ¶«Î÷,µ½ÍøÉÏËÑË÷Á˺ܾÃ,²»ÊÇÌ«ÂÒ¾ÍÊÇ˵²»Çå³þ!
¾Ù¸öÀý×ÓÀ´Ëµ,¾Í˵SessionºÃÁË,²»ÖªµÀÍøÉϵÄÄÇЩ¼Ò»ïµ½µ×ÔÚ½²Ê ......

ASP.NET 2.0ÖÐʵÏÖÄ£°åÖеÄÊý¾Ý°ó¶¨

Ä£°å»¯µÄÊý¾Ý°ó¶¨¿Ø¼þΪÎÒÃÇÔÚÒ³ÃæÉÏÏÔʾÊý¾ÝÌṩÁ˸ù±¾µÄÁé»îÐÔ¡£Äã¿ÉÄÜ»¹¼ÇµÃASP.NET v1.xÖеöÄ£°å»¯¿Ø¼þ£¨ÀýÈçDataListºÍRepeater¿Ø¼þ£©¡£ASP.NET 2.0ÈÔȻ֧³ÖÕâЩ¿Ø¼þ£¬µ«ÔÚÄ£°åÖаó¶¨Êý¾ÝµÄÓï·¨ÒѾ­±»¼ò»¯ºÍ¸ÄÉÆÁË¡£±¾ÎĽ«ÌÖÂÛÔÚÊý¾Ý°ó¶¨¿Ø¼þÄ£°åÖаó¶¨Êý¾ÝµÄ¶àÖÖ·½·¨¡£
Êý¾Ý°ó¶¨±í´ïʽ
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖÐ ......

asp.net Òì²½Ò³Ãæ

ǰ¼¸ÌìÎÒûÊÂÔÚͼÊé¹Ý½è±¾··ºÙºÙ£¬Í¦ÓÐÒâ˼µÄ£¬ÁíÍâÄÇÌìÔÚÌù°É¿´µ½µÄÒ»²ÅÅ®µÄÎÊÌâͻȻÏëµ½ÁË··¾Í¿´ÁË¿´£¬Í¦ÓÐÒâ˼µÄ¡£
¾ßÌå×ܽáµÄÄÚÈÝÎÒ½ñÌìд³öÀ´£¬¿ÏÄÜÓе㳤£¬µ«ÊǶÔÍøÕ¾¾ø¶ÔÓÐÓá£
  Ò³ÃæµÄ´¦ÀíĬÈÏÇé¿öÏ£¬´¦ÀíASP¡£NETÒ³ÃæµÄÄ£Ðͱ¾ÖÊÉÏÊÇͬ²½µÄ¡£Õâ˵Ã÷£¬Ò³ÃæµÄÁ÷³ÌÊǹ̶¨µÄ£¬Ã¿Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ