Here is I'm trying to get IP address in a web application when it's page
load using C#. The following code will help u for getting IP
address....
Happy coding!!
using System.Net;
string hostName = Dns.GetHostName();
IPHostEntry iPHostEntry = Dns.GetHostEntry(hostName);
IPAddress[] ipAddress = iPHostEntry.AddressList;
for (int i = 0; i <
ipAddress.Length; i++)
{
Response.Write(ipAddress[i].ToString());
Response.Write("<br/>");
}
Happy coding!!
No comments:
Post a Comment