static±äÁ¿Óëasp.net
ÔÚC#ÖУ¬static±äÁ¿±íʾ¸Ã±äÁ¿ÊôÓÚÀ࣬¶ø²»ÊÇÀàµÄʵÀý¡£¿ÉÒÔ˵ÊǸÃÀàµÄËùÓÐʵÀý¹²ÏíÒ»¸östatic±äÁ¿¡£
asp.netµÄÒ³Ãæ¾ÍÊÇÒ»¸öÀ࣬ÎÒÃÇ·ÃÎÊÒ»¸öÒ³Ãæ¡£¾Í»áÔÚ·þÎñÆ÷ÉÏʵÀý»¯Ò»¸ö¸ÃÀàµÄʵÀý£¬À´ÏìÓ¦ÎÒÃǵÄÇëÇó¡£
“ËùÓÐʵÀý¹²ÏíÒ»¸östatic±äÁ¿” Õâ¾ÍÒâζ×Å£¬ËùÓеĿͻ§¶Ë·ÃÎʵ½µÄasp.netÒ³ÃæÖÐstatic±äÁ¿¶¼ÊÇͬһ¸ö±äÁ¿¡£
ÓÉÓÚÎÒÃÇÿ´Î·ÃÎÊasp.netÒ³Ãæ¶¼ÊÇÒ»¸öȫеĶÔÏ󣬶ø²»ÊÇÎÒÃÇÉÏÒ»´Î·ÃÎʵĶÔÏó¡£ËùÒÔÉÏ´ÎÒ³Ãæ·ÃÎÊʱÎÒÃǶÔÒ³ÃæÖбäÁ¿µÄ¸Ä¶¯¶¼Ã»Óб£Áô¡£Óöµ½Õâ¸öÎÊÌâµÄʱºò£¬ºÜ¶à³õѧÕßµÄÖ±¾õ¾ÍÊǽ«Õâ¸ö±äÁ¿ÉêÃ÷Ϊstatic£¬×Ô¼ºÔÚ²âÊÔµÄʱºò·¢ÏÖ»¹ÕæµÄ±£ÁôסÁËÒ³ÃæµÄ״̬¡£ÇÔϲ֮ÓàûÓз¢ÏÖÕâÓÖÓÐÒýÈëÁËÁíÍâÒ»¸ö´íÎó¡£ÒòΪÄãÒªµÄÖ»ÊÇÒ³ÃæÄܱ£Áôס״̬£¬¶øÕâ¸ö״̬ÊÇÕë¶ÔÒ»¸ö¿Í»§¶ËµÄ£¨sessionµÄЧ¹û£©¡£¶øµÃµ½µÄ½á¹ûÊÇÖ»ÒªÒ»¸ö¿Í»§¶Ë¸Ä±äÁ˸ÃÖµËùÓÐµÄÆäËû¿Í»§¶Ë¶¼Êܵ½ÁËÓ°Ï죨ÈçͬApplicatinµÄЧ¹û£©¡£ÕâÖÖÇé¿öÏ£¬ÐèÒªµÄ¼«ÓпÉÄܾÍÊǸöViewState»òÕßÊÇSession¡£
ÔÌûµØÖ· http://www.cnblogs.com/meyer/archive/2004/04/27/7846.aspx
Ïà¹ØÎĵµ£º
ÈçºÎͨ¹ýASP.NETÀ´ÏÂÔØÎļþ£¬Õâ¸öÎÊÌâÎÒÃǾ³£Óöµ½£¬°Ñ³£Óõķ½·¨×ܽᵽһÆð£¬Ñ§Ï°Ñ§Ï°¡£µ±ÎÒÃÇÒªÈÃÓû§ÏÂÔØÒ»¸öÎļþ£¬×î¼òµ¥µÄ·½Ê½ÊÇͨ¹ýResponse.RedirectÖ¸Á
Response.Redirect("test.doc")
Äú¿ÉÒÔ°ÑÉÏÃæÕâÐÐÖ¸Áî·ÅÔÚButtonµÄClickʼþµ±ÖУ¬µ±Óû§µã»÷°´Å¥Ö®ºó£¬ÍøÒ³¾Í»á±»×ªÖ·µ½¸Ãwordµµ£¬Ôì³ÉÏÂÔØµÄЧ¹û¡£
µ«Ê ......
1.²ÉÓÃÁ÷È¡µÃͼƬ´óС¡¡
Stream stream=file.PostedFile.InputStream;
System.Drawing.Image image=System.Drawing.Image.fromStream(stream);
Image.Width
Image.Height
2.ʹÓÃÎļþµÃµ½Í¼Æ¬´óС
System.Drawing.Image image=System.Drawing.Image.fromFile£¨Í¼Æ¬Â·¾¶£©
Image.Width
Image.Height ......
ASP.net »ñµÃ¿Í»§¶ËµÄIP£¬×î³£¼ûµÄÊÇʹÓÃÏÂÊö´úÂ룺 string user_IP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
¶ÔÓÚÁ˽â´úÀí·þÎñÆ÷Çé¿öµÄÈË£¬ÎÒÃÇ»áÖªµÀ£¬Èç¹ûÓû§Ê¹ÓÃÁË´úÀí·þÎñÆ÷£¬ÉÏÊö´úÂë»ñµÃµÄÊÇ´úÀí·þÎñÆ÷µÄIPµØÖ·£»Èç¹ûÓû§Ê¹ÓÃÁ˶à¸ö´úÀí·þÎñÆ÷£¬ÔòÊǵ½´ï·þÎñÆ÷µÄ×îºóÒ ......
ÔÀ´µÄMembership
ÎÒÃÇÖªµÀÔÚAsp.Net 2.0ÖÐ΢Èí¾ÍΪÎÒÃÇÌṩÁËÇ¿´óµÄȨÏÞ¹ÜÀí¹¦ÄÜÀ´°ïÖúÎÒÃǹÜÀíAsp.NetÏàÓ¦µÄȨÏÞ£¬ÆäʵËüÊǶÔÎÒÃǵÄÉí·ÝÈÏÖ¤ºÍȨÏÞ¹ÜÀíµÄÒ»ÖÖ³éÏó¡£ÕâÀï¼òµ¥µÄÁ˽âÒ»ÏÂMembership£º
ÎÒÃÇÓ¦¸ÃÖªµÀ΢Èí¹ØÓÚÈÏÖ¤·½Ãæ¸øÎÒÃÇÌṩÁËÈýÖÖÈÏÖ¤·½Ê½windows ¡¢Forms¡¢Passport,ÎÒÏëÊìϤAsp.Net ......