When retrieving URL via HttpWebRequest, can I see the IP address of the destination server?
问题 Suppose I am retrieving a url as follows: string url = "http://www.somesite.com/somepage.html" HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); Is there a way I can see the IP address of the destination url? Does it require a separate call? Thanks 回答1: Look at the System.Net.Dns class. You can get a list of IP addresses of the host from the Dns.GetHostEntry() method. 回答2: Although Dns.GetHostEntry() can get you the IP of