asp.net原本用Request.Url 在Core大部分需要改使用Context.Request
Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Request) => http://localhost:60467/Home/About
【Request.Url.Scheme】Context.Request.Scheme => http
【Request.Url.Host】Context.Request.Host.Host => localhost
【Request.Url.Authority】Context.Request.Host.Value => localhost:60467
【Request.Url.LocalPath】Context.Request.Path => /Home/About
【Request.Url.Port】Context.Request.Host.Port => 60467
ASP.NET 如何取得 Request URL 的各個部分
https://blog.miniasp.com/post/2008/02/10/How-Do-I-Get-Paths-and-URL-fragments-from-the-HttpRequest-object
ASP.NET內抓取網址的方式一覽表(Request)
https://demo.tc/Post/230
沒有留言:
張貼留言