ユーザーがブラウザに入力した正確な URL を取得したいと思います。もちろん、私はいつでも次のようなものを使用できますRequest.Url.ToString()が、これは次の状況で私が望むものを与えません:
http://www.mysite.com/rss
上記のURLを使用すると、次のようRequest.Url.ToString()になります。
http://www.mysite.com/rss/Default.aspx
これを達成する方法を知っている人はいますか?
私はすでに試しました:
Request.UrlRequest.RawUrlthis.Request.ServerVariables["CACHE_URL"]this.Request.ServerVariables["HTTP_URL"]((HttpWorkerRequest)((IServiceProvider)HttpContext.Current).GetService(typeof(HttpWorkerRequest))).GetServerVariable( "CACHE_URL")((HttpWorkerRequest)((IServiceProvider)HttpContext.Current).GetService(typeof(HttpWorkerRequest))).GetServerVariable( "HTTP_URL")