介绍一下ASP.NET取得当前页面的完整URL 的方放,icech做成了函数,直接用吧!
private string GetPath() { string strPath = "http://" + Request.ServerVariables["HTTP_HOST"] + Request.ServerVariables["PATH_INFO"] + "?" + Request.ServerVariables["QUERY_STRING"]; if(strPath.EndsWith("?")) { strPath = strPath.Substring(0, strPath.Length - 1); } return strPath; }
|