IPHostEntry hostInfo = Dns.GetHostByName("www.baidu.com"); Response.Write(hostInfo.AddressList[0].ToString());需要引用 using System.Net;
//获取URL地址string url = Request.Url.ToString();txtUrl.Text = url;//获取IP地址string ips= Request.UserHostAddress.ToString();