参考资料:https://sites.google.com/site/netcorenote/asp-net-core/get-scheme-url-host Example there's an given url: http://localhost:4800/account/login 获取整个url地址: 在页面(cstml)中 Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Context.Request); 在…
获取URL信息的类 使用这个类,你能获得URL的如下信息: - Host - Path - Statuscode (eg. 404,200, ...) - HTTP Version - Server - Content Type - Date - The whole header string of the URL 复制代码 代码如下: <? /** * Class for getting information about URL's * @author Sven Wage…