this.Request.UserHostAddressthis为一个页面

解决方案 »

  1.   

    不行啊,这种方法在codebehind代码页中不起作用。
      

  2.   

    试试这个
    Request.ServerVariables("REMOTE_ADDR")
      

  3.   

    对不起,问题说错了,是如何在自定义命名空间中的方法里取得客户端IP和如何使用application变量。
      

  4.   

    客户端:Request.UserHostAddress
    服务器端:Request.ServerVariables("REMOTE_ADDR")
      

  5.   

    在自定义命名空间的方法中,Request.好像没用。
      

  6.   

    System.Web.HttpContext.Current.Request.UserHostAddressSystem.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]