Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ÌØÊâ×Ö·ûµÄÒâ˼(ûÍêÉÆ)

“<%#....%>” ÕâÊÇÊý¾Ý°ó¶¨£¬ÀïÃæ¿ÉÒÔµ÷ÓÃC#µÄ·½·¨¡£
“<%$....%>" û¼û¹ýÕâ¸ö¡£
“<%@...%>”Õâ¸öÊÇÒ³ÃæÖ¸Áһ°ã·ÅÔÚÿ¸öÒ³ÃæµÄ×î¶¥²¿£¬¶ÔÒ³ÃæµÄÔËÐнøÐпØÖÆ£¬ÈçÉèÖûº´æ£¬ÒýÓÃÓû§¿Ø¼þ£¬µ¼ÈëÃüÃû¿Õ¼ä==
ÁíÍ⻹ÓÐÒ»¸ö<%= ...%>  Õâ¸ö=ºÅºóÒ²¿ÉÒÔµ÷ÓÃC#µÄ·½· ......

ÈçºÎʹÓÃASP.NET Profile


Asp.NetÖÐÓÐÒ»Ì×ÓëÓû§Ïà¹ØÁªµÄÊôÐÔÉèÖ㬿ÉÒÔͨ¹ýÔÚWebConfigÀïÅäÖÃÀ´Ö±½ÓʹÓã¬ËûµÄ×÷ÓÃΪ
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
Asp.Net ProfileÌṩµÄ¸úÓû§Ïà¹ØµÄÀàÐͶ¼ÊÇÇ¿ÀàÐÍ
Ê×ÏÈÉú³ÉÊý¾Ý¿â½Å±¾£¬Ê¹ÓÃVisual Studio 2005 ÃüÁîÌáʾ£¬ÊäÈë ......

asp.net mvc 2.0²¿Êð

IIS 7
IIS7×ÔÉíÓжÔMVCµÄÖ§³Ö£¬²¿Êð·½·¨Í¬ÆäËûweb application»ù±¾Ïàͬ£¬ÐèҪעÒâµÄÊÇ£¬mvc 2.0 applicationÔÚHandler MappingsÀïÃæ»áÓÐMvcHttpHandler£¬Èçͼ£º
ÎÒʹÓõÄÊÇ.net 4.0£¬ÎÒ¿´ÁËÆäËû.net 2.0 µÄweb appliationϵÄHandler Mappings¶¼Ã»ÓÐÕâ¸öhandler maping¡£
×¢Ò⣺.net 3.5ÒÔÏ£¨°üÀ¨£©µÄweb application p ......

ASP.NET Mischellous

@Register : Register a user control or class with alias to this page.
@Import: Import a namespace.
@Reference: Link user controls or other page to complile current page. Ö§³ÖÊý¾Ý¿çÒ³ÃæµÄ´«ËÍ
Ò³ÃæÊ¼þ£ºPreInit(´´½¨·þÎñÆ÷¿Ø¼þ), Init(³õʼ»¯·þÎñÆ÷¿Ø¼þµÄ״̬), InitComplete,PreLoad, Load, Lo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ