Friday, March 23, 2007

Get HostName and IP Address

System.Net.IPHostEntry host =new System.Net.IPHostEntry();
private void Page_Load(object sender, System.EventArgs e)
{
host = System.Net.Dns.GetHostByAddress
(Request.ServerVariables["REMOTE_HOST"]);

Response.Write(host.HostName+"\n"+"IP :"+
Request.ServerVariables["REMOTE_ADDR"]);
}






No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.