"http://"是協議名 "www.test.com"是域名 "aaa"是站點名 "bbb.aspx"是頁面名(文件名) "id=5&name=kelli"是參數 //獲取 完整url (協議名+域名+站點名+文件名+參數) string url = Request.Url.ToString(); url = "http://www.test.com/aaa/bbb.aspx?id=5&name=kelli"; //獲取 站點名+頁面名+參數: string url = Request.RawUrl; string url = Request.Url.PathAndQuery; url= "/aaa/bbb.aspx?id=5&name=kelli"; //獲取 站點名+頁面名: string url = Request.Url.AbsolutePath; string url = Request.Path; url= "aaa/bbb.aspx"; //獲取 域名: string url = Request.Url.Host; url= "www.test.com"; //獲取 參數: string url = Request.Url.Query; url= "?id=5&name=kelli";//若是有端口的話int port = System.Web.HttpContext.Current.Request.Url.Port;//得到網站訪問來源地址Request.ServerVariables["HTTP_REFERER"]//或者Request.UrlReferrer