Hi Viewers,
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....
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());
}
S.VinothkumaR
5 comments:
sir i tried it in console.after replacing response.rite into consoe.write it display the result. thanks
How to assign a IP address to a machine???
Awesome...it works fine.Thanks Vinoth..
Many Thanks.
Thankxxxxx..!
Post a Comment