如何从我的网站获取上一页的绝对网址。 [英] How to get absolute url of previous page out of my website.
问题描述
亲爱的所有人,
我想获得上一页的完整网址,例如我通过搜索访问codeproject(http://www.codeproject.com) google上的codeproject,其网址为https://www.google.co.in/?gfe_rd=cr&ei=NLpGU_j8IeSL8QfckoGIDw#q=code+project。
我想在我的页面上显示这个谷歌绝对网址。
我有网址但不是绝对网址为https:// www.google.co.in/?gfe_rd=cr&ei=NLpGU_j8IeSL8QfckoGIDw#q=code+project。
我使用的代码:
< pre lang =C#> Uri MyUrl = Request.UrlReferrer;
Response.Write( Referrer URL: + Server.HtmlEncode(MyUrl.ToString( ))+ < br>);
Response.Write( Referrer URL Port: + Server.HtmlEncode(Request.Url) .AbsoluteUri.ToString())+ < br>);
Response.Write( Referrer URL Protocol: + Server.HtmlEncode(MyUrl.Scheme) )+ < br>);
Response.Write( 推荐人IP: + ClientIPAddress()+ < br>);
提前致谢。
Dear All,
I want to get complete url of previous page like i am visiting to codeproject(http://www.codeproject.com)by searching codeproject on google having url as "https://www.google.co.in/?gfe_rd=cr&ei=NLpGU_j8IeSL8QfckoGIDw#q=code+project".
I want to display this google absolute url on my page.
I have got the url but not absolute url as https://www.google.co.in/?gfe_rd=cr&amp;ei=NLpGU_j8IeSL8QfckoGIDw#q=code+project.
The code used by me:
Uri MyUrl = Request.UrlReferrer;
Response.Write("Referrer URL : " + Server.HtmlEncode(MyUrl.ToString()) + "<br>");
Response.Write("Referrer URL Port: " + Server.HtmlEncode(Request.Url.AbsoluteUri.ToString()) + "<br>");
Response.Write("Referrer URL Protocol: " + Server.HtmlEncode(MyUrl.Scheme) + "<br>");
Response.Write("Referrer IP: " + ClientIPAddress() + "<br>");
Thanks in advance.
这篇关于如何从我的网站获取上一页的绝对网址。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!