C#代码
- public string GetIPByDomain(string url)
- {
- if (url.Trim() == string.Empty)
- return "";
- try
- {
- System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(url);
- return host.AddressList.GetValue(0).ToString();
- }
- catch (Exception e)
- {
- throw e;
- }
- }
Submitted by jsing on 2008, December 9, 5:24 PM. Web相关