日期:2014-05-17  浏览次数:20529 次

如何获取跳转后的地址。
本帖最后由 terry2018 于 2014-02-21 13:23:03 编辑
跳转前地址:

http://jump.zhineng.58.com/clk?target=mv7V0A-b5HThmvqfpv--5yOdUAkhuA-1pyEquH9LnWmOnjbVm19zuBYYmh7bsHbOnjnVPyuWuhPhPHbvnAubFMP_ULEqUA-1IAQ-uMEhuA-
1IAYqnHnOnWbdnWmOPj93PBuzuymqpZwY0jCfsvFJsWN3shPfUiqWpZRlIith0vqd0hP-5HDhIh-1Iy-b5HDvP1DYnjm1rHnQrHDQFMuG0LRG0jYQnWn8nHD1sWn3sW0dFhR8IZwk5HTh0A7zmyYqFh-
1ug6YuyOb5yu6UZP-FMK_uWYVniudpyEqnHEYrjcvP19dPWTzPWnhmvQopyEqn1nzmHRWmycVPWNdPaYYuHKBsyDzrH0VmhnOmvcYuymLrjckFMKGujYOFhR8IA-
b5HDvrHT3nW0znH9OPH0vFhR8IZwk5HTh0ZFGmvNqnHbQFMF-uA-
z5y6YIZTlszqBpB3draOWUvYfXMRhmyOMs1DvrHT3nW0znH9OPH0vXaO1pZwVUaubpgPkULnqniu1IyFGujYdnjbQnWb1FhPzuy7YuyEqPHT3P1nknzukmgF6Uy-b5iubpgPWmHY3FMP-
UAuWmHY3FhwG0vQf5HDh0vR_uhQf5HDh0HYQPjbhmyFY5yD


跳转后地址:http://bj.58.com/zufang/16908272189576x.shtml

在地址栏输入跳转前的地址,转向到了http://bj.58.com/zufang/16908272189576x.shtml。


问题:现在要用程序请求跳转前的地址,获取跳转后的地址,打下请帮助。






------解决方案--------------------
string url = @"http://jump.zhineng.58.com/clk?target=mv7V0A-b5HThmvqfpv--5yOdUAkhuA-1pyEquH9LnWmOnjbVm19zuBYYmh7bsHbOnjnVPyuWuhPhPHbvnAubFMP_ULEqUA-1IAQ-uMEhuA-1IAYqnHnOnWbdnWmOPj93PBuzuymqpZwY0jCfsvFJsWN3shPfUiqWpZRlIith0vqd0hP-5HDhIh-1Iy-b5HDvP1DYnjm1rHnQrHDQFMuG0LRG0jYQnWn8nHD1sWn3sW0dFhR8IZwk5HTh0A7zmyYqFh-1ug6YuyOb5yu6UZP-FMK_uWYVniudpyEqnHEYrjcvP19dPWTzPWnhmvQopyEqn1nzmHRWmycVPWNdPaYYuHKBsyDzrH0VmhnOmvcYuymLrjckFMKGujYOFhR8IA-b5HDvrHT3nW0znH9OPH0vFhR8IZwk5HTh0ZFGmvNqnHbQFMF-uA-z5y6YIZTlszqBpB3draOWUvYfXMRhmyOMs1DvrHT3nW0znH9OPH0vXaO1pZwVUaubpgPkULnqniu1IyFGujYdnjbQnWb1FhPzuy7YuyEqPHT3P1nknzukmgF6Uy-b5iubpgPWmHY3FMP-UAuWmHY3FhwG0vQf5HDh0vR_uhQf5HDh0HYQPjbhmyFY5yD";
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
            request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.2; zh-CN; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8";
            request.Accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
            request.AllowAutoRedirect = true;
            request.Headers.Add(HttpRequestHeader.AcceptCharset, "gb2312,utf-8;q=0.7,*;q=0.7");
            request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
            request.Headers.Add(HttpRequestHeader.Cookie, "id58=05dz8VMG5yk8RCViPEsFAg==; city=wz; 58home=wz; ipcity=wz%7C%u6E29%u5DDE; myfeet_tooltip=end; __utma=253535702.1542940914.1392961328.1392961328.1392961328.1; __utmc=253535702; __utmz=253535702.1392961328.1.1.utmcsr=(direct)
------解决方案--------------------
utmccn=(direct)
------解决方案--------------------
utmcmd=(none)");
            request.Timeout = 30000;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            if (stream != null)
            {
 &nbs