相关疑难解决方法(0)

获取用户在浏览器中输入的确切URL

我想获得用户输入浏览器的确切网址.当然我总是可以使用类似的东西,Request.Url.ToString()但在下列情况下,这并没有给我我想要的东西:

http://www.mysite.com/rss

上面的url Request.Url.ToString()会给我的是:

http://www.mysite.com/rss/Default.aspx

有谁知道如何做到这一点?

我已经尝试过了:

  • Request.Url
  • Request.RawUrl
  • this.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")

c# asp.net url request

8
推荐指数
1
解决办法
7218
查看次数

标签 统计

asp.net ×1

c# ×1

request ×1

url ×1