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

asp.netÎļþÉÏ´«´úÂë\Êý¾Ý¿âÇÉÃîÁ¬½Ó


public class Up_Loadcs
{
     public string[] Resup={"ÉÏ´«Ê§°Ü»òÖ¸¶¨µÄÎļþ²»´æÔÚ","ͼƬ´óÓÚ10K£¬ÖØд«Í¼Æ¬£¡","¸ñʽ²»¶Ô£¬ÏÞÖÆÉÏ´«£¨Ö»ÔÊÐígif/jpg¸ñʽÎļþ£©£¡","ÉÏ´«³É¹¦£¡"};
           public string s = string.Empty;
     public string Up(System.Web.UI.HtmlControls.HtmlInputFile File2,string Pa)
     {
      //
      // TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼­
      //
  
      if (File2.PostedFile.ContentLength.ToString() == "0")
      {
       return "0";
      }
      else
      {
       //»ñÈ¡ÎļþÃû³Æ
       string ss ;
       ss =System.DateTime.Now.ToString().Replace("-","").Replace(" ","").Replace(":","")+Path.GetExtension(File2.PostedFile.FileName);
       if (File2.PostedFile.ContentLength/1024>10)
       {return "1";}
       else
       {
        string ty=File2.PostedFile.ContentType;
        if (ty=="image/gif"||ty=="image/pjpeg")
        {
         File2.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath(Pa) + ss);
                           s= ss;
                          


Ïà¹ØÎĵµ£º

ASP.NET¶ÔÇëÇó´¦ÀíµÄ¹ý³Ì

ASP.NET¶ÔÇëÇó´¦ÀíµÄ¹ý³Ì
µ±ÇëÇóÒ»¸ö*.aspxÎļþµÄʱºò£¬Õâ¸öÇëÇó»á±»inetinfo.exe½ø³Ì½Ø»ñ£¬ËüÅжÏÎļþµÄºó׺£¨aspx£©Ö®ºó£¬½«Õâ¸öÇëÇóת½»¸ø ASPNET_ISAPI.dll£¬ASPNET_ISAPI.dll»áͨ¹ýhttp¹ÜµÀ£¨Http PipeLine£©½«ÇëÇó·¢Ë͸øASPNET_WP.exe½ø³Ì£¬ÔÚASPNET_WP.exe½ø³ÌÖÐͨ¹ýHttpRuntimeÀ´´¦ÀíÕâ¸öÇëÇ󣬴¦ÀíÍê±Ï½«½á¹û·µ»Ø ......

ÕýÈ·ÈÏʶWebFormÓëAsp.NET MVC

1.´«Í³WebForm¿ª·¢ÖдæÔÚµÄһЩÎÊÌâ
 ´«Í³µÄASP.NET¿ª·¢ÖУ¬Î¢ÈíµÄ¿ª·¢ÍŶÓΪ¿ª·¢ÕßÉè¼ÆÁËÒ»¸öÔÚ¿ÉÊÓ»¯Éè¼ÆÆ÷ÖÐÍϷſؼþ£¬±àд´úÂëÏìӦʼþµÄ¿ìËÙ¿ª·¢»·¾³¡£È»¶ø£¬ËüËù´øÀ´µÄ¸ºÃæЧӦÊÇ£º 
 ÓÉÓڿؼþ·â×°Á˺ܶණÎ÷£¬¿ª·¢ÕߺÜÄÑÁ˽âÕâ±³ºóµÄHTMLÊÇÈçºÎÔË×÷µÄ
ÈÝÒ׵õ½Ò»¸ö°üº¬´óÁ¿ViewStateµÄÒ³Ã棬ʹµÃÒ ......

Ò»¸öÒ»Ö±¶¼ÈÃÈ˺öÂÔµÄASP.NET°²È«ÎÊÌâ.


×Ô´ÓIE6 SP1Æð , Õâ¸öä¯ÀÀÆ÷¾ÍÖ§³ÖcookieµÄhttpOnlyÊôÐÔ.
Õâ¸öÊôÐÔ, ¸æËßä¯ÀÀÆ÷, ʹÓà window.document.cookie ²»ÔÊÐí·ÃÎʸÃcookie .
¶øÔÚASP.NET2.0ÖÐ , Õâ¸öÊôÐÔÒ²µÃµ½ÁËÖ§³Ö, ²¢ÇÒÔÚFormAuthenticationÖÐÖ¸¶¨¸ÃÊôÐÔ.
µ«ÊÇ,FireFoxµÈä¯ÀÀÆ÷, ²¢²»Ö§³Ö¸ÃÊôÐÔ. ÄÇôÕâ¸ö´øÀ´Ê²Ã´ºó¹û?
ÀýÈç , ¼ÙÈçÄãÓÃFireFoxµÇ¼²©¿Í ......

¿Í¹Û¿´´ýViewState¶ÔAsp.net³ÌÐò×÷ÓúÍÓ°Ïì


Ç°¶Îʱ¼äÓÉÓÚ³ÌÐò³öÏÖÁ˱ȽϴóµÄÐÔÄÜÎÊÌ⣬ÊÓͼ£¨View£©Ö®¼äµÄÌøתËٶȷdz£Âý¡£Í¨¹ýFiddlerµ÷ÊԺͷÖÎö£¬²éÕÒµ½ÊÇÓÉÓÚÔÚÊÓͼ(View)ת»»
£¨PostBack£©¹ý³ÌÖУ¬¿Í»§¶Ë¸ø·þÎñÆ÷¶ËµÄ·¢ËÍ×Ö½ÚÊý·Ç³£´ó£¬Ò»°ãÔÚ30KÒÔÉÏ£¬¾ÍÏ൱ÓÚ¿Í»§¶Ëÿ´Î¶¼Òª¸ø·þÎñÆ÷ÉÏ´«´óÊ®KµÄÊý¾ÝÁ¿£¬ÕâÈç¹ûÊDZȽÏ
ºÃµÄÍøÂç»·¾³ÏÂÍêÈ«ÊÇ¿ÉÒÔºöÂԵģ¬µ«ÊÇÄ ......

asp.net£¨C#£©ÖÐÎÄÂÒÂëÎÊÌâ

asp.netĬÈϵıàÂëÊÇUTF-8
jsÎļþÀïµÄ±àÂëÒ²ÊÇUTF-8
µ±ÄãÒªÔÚaspxÒ³ÃæÉϽøÐд«ÖÐÎIJÎÊýʱ»á³öÏÖÂÒÂë
<-----request.aspx--½ÓÊÕ²ÎÊýÒ³----->
<----response.aspx--´«ËͲÎÊýÒ³----->
ÀýÒ»£º<a href="request.aspx?str=ÖйúÈË"></a>
½â¾ö°ì·¨Ò»£º
1.¿ÉÒԺ͸ÄwebconfigµÄ±àÂë È磺
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ