3

I have deployed an application on the IIS server, as per my requirement i need to get IP-Address of hosted machine which is on the network and i have just host-name of the machine using c# e.g

http://abc

Where abc is deployed on IIS which can be any where on the network i don't know. Is it possible to get IP-Address using this host-name with c#

4

1 回答 1

3

Include

using System.Net;

and use

string url = "www.howtogeek.com";
IPAddress[] addresslist = Dns.GetHostAddresses(url);

The following answer also might be helpfule

How to get my own IP address in C#?

于 2012-06-19T07:50:32.803 回答