StringBuilder strBuider = new StringBuilder(); strBuider.Append("客户端主机的IP地址:" + HttpContext.Current.Request.UserHostAddress + "</br>"); strBuider.Append("客户端浏览器版本:" + Request.UserAgent + "</br>"); strBuider.Append("当前由哪个页面URL跳转过来:" + Request.UrlReferrer+ "</br>"); strBuider.Append("当前要求的URL:" + Request.Url + "</br>"); strBuider.Append("当前要求的URL绝对地址:" + Request.Url.AbsolutePath + "</br>"); strBuider.Append("当前要求的URL绝对URI:" + Request.Url.AbsoluteUri + "</br>"); strBuider.Append("当前要求的URL主机名跟端口:" + Request.Url.Authority + "</br>"); strBuider.Append("当前要求的URL实例主机的一部分:" + Request.Url.Host + "</br>"); strBuider.Append("当前要求的URL端口:" + Request.Url.Port + "</br>"); strBuider.Append("当前要求的URL的内容第一个段:" + Request.Url.Segments[0] + "</br>"); strBuider.Append("当前要求的URL的内容第二个段:" + Request.Url.Segments[1] + "</br>"); strBuider.Append("当前要求的URL的内容第三个段:" + Request.Url.Segments[2] + "</br>"); strBuider.Append("浏览器地址栏后的参数"+Request.QueryString + "</br>"); strBuider.Append("当前网页在服务器端的实际路径:" + Request.PhysicalPath + "</br>"); strBuider.Append("当前文件的物理地址:" + Request.PhysicalApplicationPath + "</br>"); strBuider.Append("当前网页的相对地址:" + Request.Path + "<br/>"); strBuider.Append("当前页面的URL:" + Request.RawUrl + "<br/>"); strBuider.Append("客户端上传的文件(个数):" + Request.Files.Count + "<br/>"); strBuider.Append("当前执行网页的相对地址:" + Request.FilePath + "<br/>"); strBuider.Append("客户端浏览器的信息:" + Request.Browser + "<br/>"); strBuider.Append("当前运行程序的服务器端虚拟目录:" + Request.ApplicationPath + "<br/>"); strBuider.Append("客户端浏览器的字符设置:" + Request.ContentEncoding + "<br/>"); Response.Write(strBuider.ToString());
这篇文档对您是否有帮助?