-1

Get a page using the httpWebRespond check the received text with the debugger and see that the links are not complete, i.e. If the code of page look in firefox like

<a href = "http:\www.server.ru\mainpage.asp"> </a>

but after getting html page by GetResponseStream () I see the following

<a href = "mainpage.asp "> </a>.

How did receive a response full of links?

4

1 回答 1

0

你没有。根据 RFC,相对 url 是完全可以接受的。它们将由用户代理(即您)解释为相对于当前 url(即您检索到的 URL,其内容返回相对 URL)。

您需要使它们相对于该 URL,因此foobar.html完整 URLhttp://somedomain/alpha/bravo/charlie/index.html被转换为http://somedomain/alpha/bravo/charlie/foobar.html.

于 2013-04-26T17:33:10.240 回答