1、网站请求协议:http
HttpContext.Current.Request.Url.Scheme;
2、网站域名:localhost
HttpContext.Current.Request.Url.Authority;
3、网站虚拟目录:/
HttpContext.Current.Request.ApplicationPath;

本文介绍在ASP.NET中如何使用HttpContext.Current.Request.Url来获取网站的请求协议、域名及虚拟目录等关键信息。
1、网站请求协议:http
HttpContext.Current.Request.Url.Scheme;
2、网站域名:localhost
HttpContext.Current.Request.Url.Authority;
3、网站虚拟目录:/
HttpContext.Current.Request.ApplicationPath;

转载于:https://www.cnblogs.com/jalonly/p/7463707.html

被折叠的 条评论
为什么被折叠?
