Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÖÐʹÓÃjsonǰºǫ́´«Öµ

ʹÓÃinput¿Ø¼þonclick´«µÝjson±È½Ï¼òµ¥£¬
ʹÓÃasp:Button ·þÎñÆ÷¿Ø¼þonclick»á»Ø·¢Ë¢ÐÂÒ³ÃæÊ¹jsonµÄÖµ¶ªÊ§¡£
ÔÚHandler1.ashxÖÐʹÓþ²Ì¬±äÁ¿´æ´¢µ±Á½¸öÈËͬʱ²Ù×÷µÄʱºò»á³öÏÖÎÊÌ⣬Èç¹ûÄúÓкõĽâ¾ö°ì·¨£¬Ï£ÍûÄÜÓÚ´ó¼Ò·ÖÏí¡£
ÒÔÏ´úÂë´ó¶àÀ´Ô´ÓÚÍøÉÏ£¬Ôڴ˸Ðл×÷Õß¡£
//ǰ̨
<script src="JS/json2.js" type="text ......

asp.net ÖÐ EvalµÄʹÓÃ

<asp:TemplateField HeaderText="²âÊÔ">
<ItemTemplate>
<asp:LinkButton ID="test" runat="server" OnClick="test_Click" OnClientClick='<%# string.Format("return confirmDelete(\"{0} {1}\");", DoEscape((string)Eval( ......

·ÀÖ¹ASP.NET°´Å¥¶à´ÎÌá½»µÄ°ì·¨

 
 ¶Ô“Ìí¼Ó”¡¢“Ìá½»”¡¢“±£´æ”¡¢“¸üДµÈ°´Å¥ÐèÒª¶ÔÊý¾Ý¿â½øÐÐд²Ù×÷µÄ°´Å¥£¬Ò»¶¨ÒªÔÚÒ³Ãæ³õʼ»¯Ê±¼ÓÔØ½Å±¾£¬·ÀÖ¹¶à´ÎÖØ¸´µã»÷£¬ÀýÈ磺
   protected void Page_Load(object sender, EventArgs e)
{
//.net 2.0ÒÔÉÏ
......

dzÎöASP.NETµÄPage.IsPostBack ÊôÐÔ

dzÎöASP.NETµÄPage.IsPostBack ÊôÐÔ
http://www.sina.com.cn 2008Äê05ÔÂ06ÈÕ 11:33  IT168.com
¡¾IT168¼¼ÊõÎĵµ¡¿
  ÏÖÔÚ´Ó¶ÔASP.NETÒ³ÃæµÄÖ´ÐÐ˳Ðò¿ªÊ¼£¬Ìå»áÒ»ÏÂB/S½á¹¹µÄ³ÌÐòµÄÌØµã£¬ÏÂͼÊÇASP.NETÒ³ÃæµÄÖ´ÐÐ˳Ðò˵Ã÷£º
  Page_Init£¨Ò³Ãæ³õʼ»¯Òý·¢µÄʼþ£©——>Page_Load£¨¼ÓÔ ......

"ÐòÁл¯" Serializable Àí½â (asp.net C#)

 ±ÈÈçÓÃÒ»¸öÀàÃèÊöÒ»ÕźÏͬ£¬¶øÕâ¸öÀàʵÀý»¯ºóÆäÖеÄ×ֶα£´æ×źÏͬµÄÐÅÏ¢£¬Èç¹ûÏÖÔÚÒª°ÑÕâ¸öÀàµÄʵÀý·¢Ë͵½Áíһ̨»úÆ÷¡¢ÁíÒ»¸ö´°Ìå»òÊÇÏë±£´æÕâ¸öÀàÒÔ±ãÒÔºóÔÙÈ¡³öÀ´Ó㨳־û¯¶ÔÏ󣩣¬¿ÉÒÔ¶ÔÕâ¸öÀà½øÐÐÐòÁл¯£¨ÐòÁл¯Êµ¼ÊÉÏÊÇÒ»¸öÐÅÏ¢Á÷£©£¬´«ËÍ»ò±£´æ£¬ÓõÄʱºòÔÙ·´ÐòÁл¯ÖØÐÂÉú³ÉÕâ¸ö¶ÔÏó
ΪʲôÄúÏëҪʹÓÃÐòÁл¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ