ysjfirst

 

获取url

 

获取当前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

posted on 2005-11-17 09:35  袁帅钧  阅读(313)  评论(0编辑  收藏  举报

导航