获取当前URL我一直使用HttpContext.Current.Request.Url.ToString(),今天Tinyfool指出我的一个Bug,调试发现,ToString()函数并不可靠。如果当前URL为http://localhost/search.aspx?user=tinyfool&tag=%BC%BC%CA%F5通过HttpContext.Current.Request.Url.ToString()获取到的却是http://localhost/search.aspx?user=tinyfool&tag=¼¼Êõ这显然不对,怎么办?用HttpContext.Current.Request.Url.PathAndQuery好了,这个得到的正确的。:)

相关文章:

  • 2021-08-14
  • 2021-11-16
  • 2021-06-18
  • 2022-02-02
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-11-05
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案