TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rottenvx
NA
1
0
Get IP Address
Aug 9 2005 4:45 PM
I am using the following code to get the localhost's internal (aka LAN) IP address (i.e. 192.168.1.1) public string GetIPAddress() { IPAddress addr = IPAddress.Any; IPHostEntry host = Dns.GetHostByAddress(addr); if (host.AddressList.Length == 0) { return "Unavailable"; } return host.AddressList[0].ToString(); } It has been working perfectly under Win2k but since I upgraded my Win2k box to Windows XP Professional this function return just "0.0.0.0" to me, even if the same project code has been preserved and same IP addressing is used by the same box. Can anyone please help me understand this anomaly and alternatively help me code a function that can return both internal and external IP addresses ? Thanks in advance.
Reply
Answers (
0
)
system notification area
Help wanted to Re-set screen resolution using C#