Saturday, July 9, 2011

How to Get the Ip Address of Client Ip in a WebPage

This is a Simple program in Asp.net Program to show the Detail of a Client visiting a particular site.

Response.Write("Your IP address is: " + Request.ServerVariables["REMOTE_ADDR"].ToString() + "
");
Response.Write("You are browsing this site with: " + Request.ServerVariables["http_user_agent"].ToString() + "
");
Response.Write("The method used to call the page: " + Request.ServerVariables["request_method"].ToString() + "
");
Response.Write("The server's domain name: " + Request.ServerVariables["server_name"].ToString() + "
");
Response.Write("The server's port: " + Request.ServerVariables["server_port"].ToString() + "
");
Response.Write("The server's software: " + Request.ServerVariables["server_software"].ToString() + "
");
Response.Write("The DNS lookup of the IP address is: " + Request.ServerVariables["REMOTE_HOST"].ToString());

No comments:

Post a Comment