Monday, March 8, 2010

Visitor's Browser Type, IP address and more in ASP

Here is a small code that can help you getting the ip address, browser type, request type and many more things..
You are browsing this site with:
<% Response.Write(Request.ServerVariables("http_user_agent"))%>
Your IP address is:
<%Response.Write(Request.ServerVariables("remote_addr"))%>
The DNS lookup of the IP address is:
<%Response.Write(Request.ServerVariables("remote_host"))%>
Local IP address is:
<%Response.Write(Request.ServerVariables("local_addr"))%>
The method used to call the page:
<%Response.Write(Request.ServerVariables("request_method"))%>
The server's domain name:
<%Response.Write(Request.ServerVariables("server_name"))%>
The server's port:
<%Response.Write(Request.ServerVariables("server_port"))%>
The server's software:
<%Response.Write(Request.ServerVariables("server_software"))%>