using System.Net;
private string GetIP() {
string strHostName = "";
strHostName = System.Net.Dns.GetHostName();
IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList;
return addr[addr.Length-1].ToString();
}
Friday, March 7, 2008
How to get IP Address of a computer in C#
Author: xiaoyu
| Posted at: 10:25 AM |
Filed Under:
.NET
Subscribe to:
Post Comments (Atom)
1 comments:
Thanks for giving the program to know the ip address.
But i know my ip address through this ip-details along with router map.
Post a Comment