Wednesday, January 23, 2013

Get IP address using C#

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++)

Happy coding!!
kick it on

No comments:

Post a Comment

If You Enjoyed This Post Please Take 5 Seconds To Share It.

^ Scroll to Top hgpromo