【1】获取 完整url
string url=Request.Url.ToString();
url= http://blog.youkuaiyun.com/hashxu/article.aspx?Action=Get&PostId=6858577
【2】获取 ID+页面名+参数:
string url=Request.RawUrl;
(或 string url=Request.Url.PathAndQuery;)
url= /hashxu/article.aspx?Action=Get&PostId=6858577
【3】获取 ID+页面名:
string url=HttpContext.Current.Request.Url.AbsolutePath;
(或 string url= HttpContext.Current.Request.Path;)
url= hashxu/article.aspx
【4】获取 域名:
string url=HttpContext.Current.Request.Url.Host;
url= blog.youkuaiyun.com
【5】获取 参数:
string url= HttpContext.Current.Request.Url.Query;
url= ?Action=Get&PostId=6858577
优快云博客解析与技术要点分享
2881

被折叠的 条评论
为什么被折叠?



