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

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.Lengt


Ïà¹ØÎĵµ£º

¡¾ASP.NETרÌâ¡¿(5)——ÈçºÎÏòView´«Öµ

ÉÏһƪÎÄÕÂÏêϸ½éÉÜÁËÈçºÎÀûÓÃASP.NET MVC´´½¨×Ô¼ºµÄÒ³Ãæ£¬ÔÚÎÄÕ½éÉÜÁËÈçºÎÀûÓÃViewDataÓÉControllerÏòViewÎļþ´«Öµ£¬ÄÇеÄÎÊÌâÔٴγöÏÖ£¬ÎÒÃdzýÁËÄÜÏÔʾaspxÎļþÍ⻹ÄÜÏÔʾÆäËüµÄÎļþô£¿
±¾ÎĽ«Ïêϸ½éÉÜÈçºÎÏòView´«Öµ¡£
Ò»¡¢ViewDataÓëTempDataÊôÐÔÀ´ÏòViewÒ³´«µÝ¶ÔÏó
ÉÏÎÄÖÐÒѾ­Ìáµ½,ʹÓÃViewData¿ÉÒÔ½«Êý¾ÝÓÉCont ......

ÈÏʶAsp.net ÖÐÏà¶Ô·¾¶Óë¾ø¶Ô·¾¶


ºÃ¶àÈ˶ÔÏà¶Ô·¾¶Óë¾ø¶Ô·¾¶ÀÏÊÇ»ìÏý¼Ç²»Çå³þ£¬ÎÒ´ÓÕûÀíÁËһϣ¬Ï£Íû¶Ô´ó¼ÒµÄÈÏʶÓаïÖú¡£
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.Request.ApplicationPath->µ±Ç°Ó¦ÓõÄĿ¼
JspÖÐ, ApplicationPathÖ¸µÄÊǵ±Ç°µÄapplication(Ó¦ÓóÌÐò)µÄĿ¼,ASP.NETÖÐÒ²ÊÇÕâ¸öÒâ˼¡£
¶ÔÓ¦ ......

´¦ÀíÓзµ»ØÖµµÄºÍreturnµÄasp.netд·¨

 SqlConnection   conPortal   =   new   SqlConnection(CommunityGlobals.ConnectionString);  
                          SqlCommand   cmdAdd   =   new   SqlCommand(   "Community_Disc ......

ASP.NET¶àƵµÀÍøÕ¾¼Ü¹¹ÊµÏÖ·½·¨

Ö÷Ìå¼Ü¹¹
¡¡¡¡¸÷ƵµÀ·Ö±ðλÓÚ²»Í¬µÄWeb Project(¾ßÓжÀÁ¢µÄ¶þ¼¶ÓòÃû)£¬²¢½«ËùÓеÄÒµÎñÂß¼­ÒÔ¼°Êý¾Ý·ÃÎʹ¦ÄÜ·â×°³ÉClass Library£¬ËùÓÐÆµµÀ¹²ÓÃÕâ¸öClass Library¡£ 
¡¡¡¡ÏÂÃæÏêϸ½éÉÜʵÏÖ·½·¨¡£ 
¡¡¡¡¼ÙÉèÍøÕ¾ÓÐÈý¸öƵµÀ£¬ÐÂÎÅ¡¢ÂÛ̳ÒÔ¼°²©¿Í£¬¶ÔÓ¦µÄ¶þ¼¶ÓòÃûΪ"news"¡¢"forum"¡¢"blog"¡£³ý´ËÖ®Í⣬»¹ÐèÒªÁ ......

ASP.NET CookieµÄʹÓûã×Ü

£±¡¢½â¾öCookie¸üÐÂÖͺóµÄÎÊÌâ
¡¡¡¡ÏÈдÈëÒ»¸ö¹ýÆÚµÄCookie£¬ÔÙÌí¼ÓÒ»¸öеÄCookie¾Í£Ï£ËÁË¡£Ê¾Àý´úÂëÈçÏÂËùʾ£º
protected void btnSearch_Click(object sender, EventArgs e)
{
//Éú³ÉÌõ¼þ±í´ïʽ
string where = bll.GetWhereSql(Int32.Parse(ddlCate.SelectedValue),
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ