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

ASP.NET»ñÈ¡¿Í»§¶ËIPµØÖ·


ͨ³£ÎÒÃǶ¼Í¨¹ýÏÂÃæµÄ´úÂë»ñµÃIP:
   string ip =System.Web.HttpContext.Current.Request.UserHostAddress;
    »ò string ip =System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
REMOTE_ADDR ˵Ã÷£º
·ÃÎÊ¿Í»§¶ËµÄ IP µØÖ·¡£
´ËÏîÐÅÏ¢Óû§²»¿ÉÒÔÐ޸ġ£
Èç¹ûÕæµÄ¸ø¸ÄÁ˵Ļ°£¬ÄãÒ²ºÍ·þÎñÆ÷Á¬½Ó²»ÁËÁË£¬·þÎñÆ÷¾ÍÊÇ°´ÕÕÕâ¸öÀ´Óë¿Í»§¶Ë½¨Á¢Á¬½Ó²¢½øÐÐͨѶµÄ¡£Êµ¼ÊÎÒ²âÊÔÐÞ¸ÄÕâ¸ö ServerVariables £¬ Ò»µãЧ¹û¶¼Ã»ÓС£ÈÔÈ»»ñµÃÊÇʵ¼ÊµÄÖµ¡£
µ«Èç¹ûÓû§Ê¹ÓÃÁË´úÀí·þÎñÆ÷£¬ÉÏÊö´úÂë»ñµÃµÄÊÇ´úÀí·þÎñÆ÷µÄIPµØÖ·£»Èç¹ûÓû§Ê¹ÓÃÁ˶à¸ö´úÀí·þÎñÆ÷£¬ÔòÊǵ½´ï·þÎñÆ÷µÄ×îºóÒ»¸ö´úÀí·þÎñÆ÷µÄIPµØÖ·¡£
ÈçºÎÈƹý´úÀí·þÎñÆ÷»ñµÃÓû§ÕæʵµÄIPµØÖ·ÄØ£¿
   
private static string getIp()
 {
     if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)  
      return System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].Split(new char[] { ',' })[0];     
    else 
      return System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
 }
Request.ServerVariables["HTTP_VIA"] ,ServerVariables["HTTP_X_FORWARDED_FOR"],Request.ServerVariables["REMOTE_ADDR"]µÄÖµ·ÖÏÂÃ漸ÖÖÇé¿ö:
Ò»¡¢Ã»ÓÐʹÓôúÀí·þÎñÆ÷µÄÇé¿ö£º
      REMOTE_ADDR = Óû§µÄ IP
      HTTP_VIA = ûÊýÖµ»ò²»ÏÔʾ
      HTTP_X_FORWARDED_FOR = ûÊýÖµ»ò²»ÏÔʾ
¶þ¡¢Ê¹ÓÃ͸Ã÷´úÀí·þÎñÆ÷µÄÇé¿ö£ºTransparent Proxies
      REMOTE_ADDR = ×îºóÒ»¸ö´úÀí·þÎñÆ÷ IP
      HTTP_VIA = ´úÀí·þÎñÆ÷ IP
      HTTP_X_FORWARDED_FOR = Óû§µÄÕæʵ IP £¬¾­¹ý¶à¸ö´úÀí·þÎñÆ÷ʱ£¬Õâ¸öÖµÀàËÆÈçÏ£º203.98.182.163, 203.98.182.163, 203.129.72.215¡£
   ÕâÀà´úÀí·þÎñÆ÷»¹Êǽ«ÄúµÄÐÅϢת·¢¸øÄúµÄ·ÃÎʶÔÏó£¬ÎÞ·¨´ïµ½Òþ²ØÕæʵÉí·ÝµÄÄ¿µÄ¡£
Èý¡¢Ê¹ÓÃÆÕͨÄäÃû´úÀí·þÎñÆ÷µÄÇé¿ö£ºAnonymous Proxies
 &n


Ïà¹ØÎĵµ£º

ASP.NETÔÚVS2008ÖÐÈçºÎʵÏÖµ÷ÊÔ£¡~~~

µÚÒ»ÖÖÊÊÓÃÓÚûÓн¨Á¢ÐéÄâ·¾¶µÄÏîÄ¿£¬¶øÇÒÏîÄ¿Ò²²»´óµÄÇé¿öÏ£¬Ö±½Ó´ò¶Ïµã£¬Ö®ºóµã»÷F5ÔËÐС£
µÚ¶þÖÖÊÊÓÃÓÚ½¨Á¢ÐéÄâ·¾¶µÄÏîÄ¿£¬´òºÃ¶Ïµã£¬Ö®ºóÑ¡Ôñµ÷ÊÔ->¸½¼Óµ½½ø³Ì->Ñ¡Ôñaspnet_wp.exe£¬Ö®ºó´ò¿ªä¯ÀÀÆ÷£¬´ò¿ªÒ³Ã棬µ½ÓжϵãµÄµØ·½»á×Ô¶¯¸ú×Ù½øÈ¥£¡~
×¢£ºÓеIJÙ×÷ϵͳ¿ÉÄÜÕÒ²»µ½aspnet_wp.exe ¿ÉÄÜ´æÔÚccc.exeÖ®À ......

Asp.netË®¾§±¨±í°²×°²¿Êð(vs2008)

ÔÚ²¿ÊðË®¾§±¨±íʱÖ÷ÒªÓöµ½Ö§³Ö×é¼þµÄÎÊÌâ¡£
Ê×ÏÈ£¬ÐèÒªÔÚ·þÎñÆ÷ÉÏÐèÒª°²×°“CRRedist2008_x86.msi”ºÍºº»¯°ü“CRRedist2008_x86_chs.msi”¡£
vs.net 2008£¬ÔÚÕâ¸öĿ¼
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5
vs.net 2005£¬ÔÚÕâ¸öĿ¼
C:\Progr ......

Asp.NET log4net µÄÓ÷¨

Óû§¿ÉÒÔ´Óhttp://logging.apache.org/log4net/ÏÂÔØlog4netµÄÔ´´úÂë¡£½âѹÈí¼þ°üºó£¬ÔÚ½âѹµÄsrcĿ¼Ï½«log4net.slnÔØÈëVisual Studio .NET£¬±àÒëºó¿ÉÒԵõ½log4net.dll¡£Óû§ÒªÔÚ×Ô¼ºµÄ³ÌÐòÀï¼ÓÈëÈÕÖ¾¹¦ÄÜ£¬Ö»Ð轫log4net.dllÒýÈ빤³Ì¼´¿É.
web.config ÖеÄÅäÖãº
<section name="log4net" type="log4net.Config.Log ......

asp.netµ¼³öExcelʱ Êý×Öת»»Îı¾µÄÎÊÌâ

Ò³Ãæµ¼³öExcelʱ£¬³£ÓõÄÖ±½ÓRenderControlµÄ·½·¨£¬Èç¹û±í¸ñÖÐÓÐÊý×Ö£¬ÔÚExcelÖÐÍùÍù¸ñʽ»áÂÒ£¬±ÈÈçÇ°ÃæÓÐ0£¬µ«ÏÔʾ³öÀ´ºó0¶¼±»È¥µôÁË¡£
Òò´ËÒªÔÚ°ó¶¨Êý×ÖµÄʱºò£¬ÊÖ¶¯Ö¸¶¨Ò»Ï´ËÁеĸñʽ£¬ÈÃÊý×ÖÒÔÎı¾·½Ê½ÏÔʾ¾ÍÐÐÁË
 protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ