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

ÓÃC#(ASP.NET)ÔõôʵÏÖÎļþÏÂÔØ¹¦ÄÜ

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
//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("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.WriteFile(fileInfo.FullName);
Response.Flush();
Response.End();
}
//WriteFile·Ö¿éÏÂÔØ
protected void Button3_Click(object sender, EventArgs e)
{
string fileName = "aaa.txt";//¿Í»§¶


Ïà¹ØÎĵµ£º

ASP.NET»º´æ


          Ò³ÃæÊä³ö»º´æ×÷Ϊ×î¼òµ¥µÄ»º´æÐÎʽ£¬Êä³ö»º´æÖ»ÊÇÔÚÄÚ´æÖб£ÁôΪÏìÓ¦ÇëÇó¶ø·¢Ë굀 HTML µÄ¸±±¾¡£ÆäºóÔÙÓÐÇëÇóʱ½«Ìṩ»º´æµÄÊä³ö£¬Ö±µ½»º´æµ½ÆÚ£¬ÕâÑù£¬ÐÔÄÜÓпÉÄܵõ½ºÜ´óµÄÌá¸ß£¨È¡¾öÓÚÐèÒª¶àÉÙ¿ªÏúÀ´´´½¨Ô­Ê¼Ò³ÃæÊä³ö - ·¢ËÍ»º´æµÄÊä³ö×ÜÊǺܿ죬²¢ÇұȽ ......

asp.netÒ³Ãæ¾²Ì¬»¯

·½·¨Ò»£º
HtmlProxy.cs£º
using System.Text;
using System.IO;
 
/// <summary>
/// HtmlProxy µÄժҪ˵Ã÷
/// </summary>
public class HtmlProxy
{
     public HtmlProxy()
     {
         //
  ......

ASP.NETµ¥ÖµºÍÁÐ±í¿Ø¼þµÄÊý¾Ý°ó¶¨

Ò»¡¢(µ¥Öµ°ó¶¨)ÔÚÒ³ÃæµÄºǫ́´úÂëÖж¨Ò幫ÓбäÁ¿,ÈçÏ£º
 public string gongYou = "ÉùÃ÷µÄ¹«ÓгÉÔ±";
¡¡¢ÙÈ»ºóÔÚÒ³ÃæµÄÔ´Öе÷Óã¬ÈçÏ£º
<asp:Label ID="lblMgs" runat="server" Text="<%#gongYou >"></asp:Label>
¡¡ ¢Úµ±È»×îºóÒª¼ÇµÃ°ó¶¨Êý¾Ý£º
 protected void Page_Load(object ......

iis6½â¾öÔËÐÐasp.net mvc

ÅäÖÃiis6½â¾öÔËÐÐasp.net mvcÏîÄ¿“ÎÞ·¨ÕÒµ½¸ÃÒ³”µÄ´íÎó
ÔÚiis6ÔËÐÐasp.net mvc ÏîĿʱ£¬Èç¹û³öÏÖ“ÎÞ·¨ÕÒµ½¸ÃÒ³”µÄÌáʾ£¬¼´404´íÎó£¬ÄÇôÓпÉÄÜÊÇiisûÓÐÉèÖú㬰´ÏÂÃæ²Ù×÷¿ÉÒÔ½â¾ö£º
´ò¿ªiis¹ÜÀíÆ÷£¬ÓÒ»÷ÏàÓ¦µÄÍøÕ¾½Úµã£¬Ñ¡Ôñ“ÊôÐÔ”¿ì½Ý²Ëµ¥£¬µ¯³öÊôÐÔ¶Ô»°¿ò£¬Ñ¡Ôñ“Ö÷Ŀ¼&rd ......

asp.net ¶ÁÈ¡XmlÎļþ²¢½øÐÐDropDownListÊý¾Ý°ó¶¨

<asp:DropDownList ID="compactType" runat="server" AutoCallBack="True" Width="153px"> </asp:DropDownList>

<?xml version="1.0" encoding="utf-8" ?>
<roots>
<root>
<id>1</id>
<Culture> ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ