How to get Server IP in asp.net

How to get Server IP:



we can get the server Ip address in over Asp.net web site .
by code.friend it's very simple .here we wright code of asp.net you put it in page load and get ..........


  • Response.Write(Request.UserHostAddress.ToString() + "<br>");
  • Response.Write(HttpContext.Current.Request.UserHostAddress.ToString() + "<br>");
  • Response.Write(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString() + "<br>");
  • Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString() + "<br>");

here UserHostAddress have property for Ip address.


Other Asp.net Related Post:



Comments