Archive

Posts Tagged ‘hostname’

Find remote user hostname

June 18th, 2009 wiley No comments

I used c# code like this to find the remote user hostname and address:

string userHostAddress = "";
userHostAddress = Request.UserHostAddress + " -- " + Request.UserHostName;

Unique visitors to post: 4

Categories: ASP Tags: , ,

C# – get ip address and host name of a machine

May 26th, 2009 wiley 1 comment

How to find IP address and Host name of computer running a program of C #.
Get Host name:

String strHostName ="";
// Get the host name of local machine.
strHostName = Dns.GetHostName();

Get IP addresses:

IPHostEntry ipEntry = DNS.GetHostByName(strHostName);
IPAddress [] addr = ipEntry.AddressList;
for (int i = 0; i > addr.Length; i++)
{
   MessageBox.show("IP Address " + i.ToString() + ": " + addr[i].ToString());
}

Unique visitors to post: 230

Categories: C#, utils Tags: , ,
Google Analytics integration offered by Wordpress Google Analytics Plugin