ÔÚ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());
&
Ïà¹ØÎĵµ£º
×î½üÓöµ½Òª¶ÁÈ¡QQÏà²áµÄÎÊÌ⣬ËùÒÔ×Ô¼ºÚÂÄ¥ÁËÏ£¬°Ñ¶ÁÈ¡Ïà²áµÄ˼·ºÍ´úÂëдÏÂÀ´¡£
ºÜ¶àÍøÕ¾µ½Í¼Æ¬Á´½Ó¶¼×öÁ˵ÁÁ´´¦Àí¡£Òâ˼ÊÇÈç¹ûÄãÏëÔÚ²»ÊÇËûµÄÍøÕ¾ÉÏÒýÓÃͼƬ¾Í²»»áÕýÈ·ÏÔʾͼƬ£¬¶øÊÇÒ»ÕÅÆäËüµÄ°æÈ¨ËµÃ÷Ö®ÀàµÄͼƬ¡£ÊµÏÖ·ÀµÁÁ´µÄÒ»°ã×öºÃÊÇͨ¹ýÅжÏRequestµÄHeadersÖеÄRe ......
VS2005µ÷ÊÔasp.net³ÌÐòʱ³öÏÖ----Internet Explorer ÎÞ·¨ÏÔʾ¸ÃÒ³Ãæ
ÈçͼËùʾ£º
ǰ¶Îʱ¼ä¿ÉÒÔµ÷ÊԵģ¬ËÖª×òÍíͻȻ²»ÐÐÁË£¬ÕÒÁ˺þã¬ÖÕÓÚÕÒµ½½â¾ö·½°¸¡£ÓõÄÊÇVS2005£¬Îļþϵͳ£¬ÔÚIISÀïÃæÉèÖõϰ£¬¿ÉÒÔÔËÐУ¬´úÂëûÎÊÌ⣬Êý¾Ý¿âÁ¬½ÓûÎÊÌâ¡£
·½°¸Ò»£ºÍ¨¹ýÓÒ»÷ASP.NET Development Server£¬Èçͼ£º
´ò¿ª1£¬ÔÚĬÈÏä¯ÀÀÆ ......
protected void Unite(GridView gv)
{
int i;
string LastType1;
int LastCell;
if (gv.Rows.Count > ......
[ת]asp.net ĸ°æÒ³Ê¹ÓÃÏê½â
ĸ°æÒ³£¨À©Õ¹ÃûÊÇ.master£©
ËüµÄʹÓøúÆÕͨµÄÒ³ÃæÒ»Ñù£¬¿ÉÒÔ¿ÉÊÓ»¯µÄÉè¼Æ£¬Ò²¿ÉÒÔ±àдºóÖôúÂë¡£ÓëÆÕÍ¨Ò³Ãæ²»Ò»ÑùµÄÊÇ£¬Ëü¿ÉÒÔ°üº¬ContentPlaceHolder¿Ø¼þ£¬ContentPlaceHolder¿Ø¼þ¾ÍÊÇ¿ÉÒÔÏÔʾÄÚÈÝÒ³ÃæµÄÇøÓò¡£
´úÂëÈçÏ£º
<%@ Master Language="C#" AutoEventWireup="true" CodeFile=" ......
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......