ÔÚASP.NETÖÐÏÂÔØÎļþ
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öÐµķ½·¨TransmitFileÀ´½â¾öʹÓÃResponse.BinaryWrite
ÏÂÔØ³¬¹ý400mbµÄÎļþʱµ¼ÖÂAspnet_wp.exe½ø³Ì»ØÊÕ¶øÎÞ·¨³É¹¦ÏÂÔØµÄÎÊÌâ¡£
´úÂëÈçÏ£º
*/
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=z.zip");
string filename = Server.MapPath("DownLoad/z.zip");
Response.TransmitFile(filename);
}
//WriteFileʵÏÖÏÂÔØ
protected void Button2_Click(object sender, EventArgs e)
{
/*
using System.IO;
*/
string fileName = "asd.txt";//¿Í»§¶Ë±£´æµÄÎļþÃû
string filePath = Server.MapPath("DownLoad/aaa.txt");//·¾¶
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.AddHeader("
Ïà¹ØÎĵµ£º
ÍøÂç´òÓ¡¸ÅÊö
¡¡¡¡• B/S½á¹¹µ¼ÖÂÁËWebÓ¦ÓóÌÐòÖдòÓ¡µÄÌØÊâÐÔ¡£
¡¡¡¡• ³ÌÐòÔËÐÐÔÚä¯ÀÀÆ÷ÖУ¬´òÓ¡»úÔÚ±¾µØ£¬¶øÎļþÈ·¿ÉÄÜÔÚ·þÎñÆ÷ÉÏ£¬µ¼ÖÂÁË´òÓ¡¿ØÖƲ»ÊǺÜÁé»î¡£
¡¡¡¡• ¸ñʽÈçºÎ¿ØÖƺͶ¨ÖƵȣ¬ÊÇÎÒÃÇ¿ª·¢ÖпÉÄÜ»áÃæ¶ÔµÄÎÊÌâ¡£
¡¡¡¡´òÓ¡ÎĵµµÄÉú³É
¡¡¡¡• 1¡¢¿Í»§¶Ë½Å±¾·½Ê½
¡¡¡¡Ò»°ãÇé¿öÏ£¬Ö÷ÒªÊ ......
ÔÚASP.NET 2.0ÖУ¬ÓÐʱºòÐèÒª¶ÔASP.NETÉú³ÉµÄHTML´úÂë½øÐд¦Àí£¬»òÕßÊDZ£´æ³É¾²Ì¬Îļþ¡£ASP.NET Ìá
¹©ÁËÖ±½Ó½«ÇëÇó±£´æ³ÉÎļþµÄ·½·¨£ºHttpRequest.SaveAs·½·¨¡£ÏÂÃæÕâ¸ö·½·¨¾ÍÊÇÔÚASP.NET 2.0Öеõ½
ASP.NETÉú³ÉµÄHTML´úÂ룬ͬʱ£¬Éú³ÉÒ»¸ö¾²Ì¬ÎļþµÄ·½·¨¡£
C#
<%@ Page Language="C#" AutoEventWireup="true" %&g ......
À´Ô´£ºhttp://www.code-123.com/html/2009917202320580.html
1.¸ú×ÙÒ³ÃæÖ´ÐÐ
ÉèÖöϵãÊÇÒ³Ãæµ÷ÊÔ¹ý³ÌÖеij£ÓÃÊֶΣ¬³ý´ËÖ®Í⣬»¹¿ÉÒÔͨ¹ý²é¿´Ò³ÃæµÄ¸ú×ÙÐÅÏ¢½øÐдíÎóÅŲéÒÔ¼°ÐÔÄÜÓÅ»¯¡£ASP.NETÖÐÆôÓÃÒ³Ãæ¸ú×ٷdz£·½±ã£¬Ö»ÐèÔÚPageÖ¸ÁîÖмÓÈëTrace="True"ÊôÐÔ¼´¿É£º
......
ASP.NET ProfileÊôÐÔ
×÷Óãº
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
ASP.NET ProfileÈçºÎ¹¤×÷
ÄãµÄWebÓ¦ÓóÌÐòÔËÐÐʱ£¬ASP.NET´´½¨Ò»¸ö´ÓProfileBaseÀද̬¼Ì³ÐÏÂÀ´µÄ¶¯Ì¬Éú³É³öÀ´µÄProfileCommonÀà¡£¶¯Ì¬ProfileCommonÀà°üº¬ÁËÄãÔÚWebÓ¦ÓóÌÐòÅäÖÃÎļ ......
Ò»¡¢Ð§¹ûͼ
1.¼òµ¥ÊôÐÔ
2.ÏÂÀ¿òÊôÐÔ
3.ÑÕÉ«ÊôÐÔ
4.°üº¬ÊôÐÔ
5.¼¯ºÏÊôÐÔ
±à¼Æ÷
6.ÈÕÆÚÊôÐÍ
¶þ¡¢³ÌÐò´úÂë
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Draw ......