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
Anthony Gags
NA
11
1.8k
Get specific IP address of PC, regardless of which adapter.
Jun 27 2017 11:10 PM
Hi There,
i have a program that is trying to get the IP address of any PC on our netowrk
I have been using the below semi-successfully, yet it will only work if an IP address actually exists in the first list.
string
HostName
=
Dns
.
GetHostName
();
Dns
.
GetHostEntry
(
HostName
).
AddressList
[
0
].
ToString
()
however,
the problem arises when the entry 0 does not exist, and it is actually entry 1 or 2 for that matter..
How can i go around this so that no matter which entry actually has the IP address of 192.168.XXX.XXX, it will p[ick it up and tell me the whole IP.
Thanks in advance
Reply
Answers (
3
)
What does compiler do internally when compile C# program?
Planning to take up classes on MVC, WCF and WPF in Chennai