[Delphi] WinInet, помогите скачать страницу вместе с заголовкми.

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by RedFern.89, 11 May 2010.

Thread Status:
Not open for further replies.
  1. RedFern.89

    RedFern.89 Member

    Joined:
    20 Jan 2010
    Messages:
    557
    Likes Received:
    45
    Reputations:
    0
    Всем доброго времени суток! как мне с помощью 1 функции скачать страницу + заголовки в таком виде:

    Code:
    HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 11 May 2010 08:43:40 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: close
    Cache-Control: no-cache,no-store,max-age=0,must-revalidate
    Content-Length: 6029
    Expires: Tue May 11 08:43:41 2010 GMT
    Last-Modified: Tue May 11 08:43:41 2010 GMT
    Set-Cookie: S=; path=/; expires=Sat, 13-May-2000 08:43:40 GMT
    Set-Cookie: S=; domain=.ya.ru; path=/; expires=Sat, 13-May-2000 08:43:40 GMT
    X-XRDS-Location: http://openid.yandex.ru/server_xrds/
    
    
    <html><head><meta http-equiv="Content-Type"content="text/html;charset=utf-8"><title>Яндекс</title><link rel="shortcut icon"href="http://yandex.st/lego/2.2.8/common/block/b-service-icon/_ico/b-service-icon_serp.ico"><base target="_top"><style type="text/css">*{font-size:100.01%;margin:0} body{font:.8em Arial,sans-serif;background:#fff url(http://www.tns-counter.ru/V13a****yandex_ru/ru/CP1251/tmsec=yandex_ya/0)} body,a{color:#999}a:hover{color:#f00!important}table{width:100%;height:100%}table table{width:65%;max-width:1000px;min-width:300px;margin:auto} table table td{padding:.25em}#text,#text input{font:100% Arial,sans-serif;width:100%}p{padding:5em 2.2em 13px}body,ul,li{padding:0;list-style:none} span{white-space:nowrap}#head{float:left;width:100%}#head li{font:85% Verdana,sans-serif;padding:5px 10px 7px 0}#head a{color:#000} #head .s{float:left;padding-left:10px}#head .s a{float:left;color:#ee7b00} #head .s i{position:absolute;width:16px;height:16px;margin-left:-19px;background:url(http://img.yandex.net/i/switch-yaru.png) no-repeat} #mail{float:right}#head .user,#head .user *{text-decoration:underline}#head .user *{color:#f00}#head .exit{color:#E03A3A}</style><script type="text/javascript">var ieHomeCheck={ URL:"http://ya.ru/", linkId:"sethome", clids:[41124], _checkClids:function(){ var D=-1; document.body.style.behavior="url(#default#homepage)"; if(document.body.isHomePage("http://ya.ru/")||document.body.isHomePage(this.URL)){ return 0 } for(var C=0;C<this.clids.length;C++){ if(document.body.isHomePage(this.URL+"?clid="+this.clids[C])){ return this.clids[C] } } return D }, _hide:function(){ document.getElementById(this.linkId).style.display="none"}, _cH:function(F,G){ var E=function(C,A,B){ return location.protocol+"//clck.yandex.ru/"+B+"/dtype="+C+"/pid=132/cid=2039/path="+A+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+"/*"+G }; var H=document.createElement("script"); H.src=E("stred",F,"jclck"); document.documentElement.getElementsByTagName("head")[0].appendChild(H) }, action:function(){ this.URL=location.protocol+"//"+location.hostname+"/"; var B=this._checkClids(); if(B>0){ this._hide(); this._cH("nextdistrib.homepage."+B,this.URL) } else{ if(B==0){ this._hide(); this._cH("nextdistrib.homepage",this.URL) } } } }; function c(A,B,C){ new Image().src=location.protocol+"//clck.yandex.ru/click/dtype=stred/pid="+B+"/cid="+C+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+"/*"+(A.href?A.href:"") } function setHome(A,B){ try{ A.style.behavior="url(#default#homepage)"; A.setHomePage(B); return false } catch(C){} } function createElement(B,A){ var D=document.createElement(B); for(var C in A){ D[C]=A[C] } return document.getElementsByTagName("head")[0].appendChild(D) };</script></head><body><table cellpadding="0"cellspacing="0"><tbody><tr><td colspan="2"valign="top"height="1"><ul id="head"><li class="s"><a id="sethome"href="http://help.yandex.ru/start/"onclick="c(this,17,1755);return setHome(this,'http://ya.ru/?clid='+(location.href.match(/clid=(\d+)/)?location.href.match(/clid=(\d+)/)[1]:'41124'))">Сделать стартовой</a></li><li id="mail"><a href="http://mail.yandex.ru"onclick="c(this,17,1080)">ВойтиВ*РІВ*почту</a></li></ul><!--[if IE]><script type="text/javascript">ieHomeCheck.action();</script><![endif]--></td></tr><tr><td colspan="2"align="center"><form action="http://yandex.ru/yandsearch" onsubmit='var clid=location.href.match(/clid=(\d+)/);location.href=this.action+"?text="+encodeURIComponent(this.text.value)+(clid?"&amp;"+clid[0]:"");return false' ><table class="b-search__wrap"><tbody><tr><td><a href="http://www.yandex.ru"onclick="c(this,17,1081)"><img src="/logo.png"alt="Яндекс"width="100"border="0"height="44"></a></td><td id="text"><div><input id="text"name="text"autocomplete="off"size="50"maxlength="300"type="search"></div></td><td><input onclick="c(this,17,1082)"value="Найти"type="submit"></td></tr></tbody></table><input value="/h0/tm6/s1"id="stpar2"name="stpar2"type="hidden"><input value="/s1"id="stpar4"name="stpar4"type="hidden"></form></td></tr><tr valign="bottom"><td width="50%"height="1"><p align="right"><span>В©В*1997—2010</span>В*В«<a href="http://www.yandex.ru"onclick="c(this,17,1083)">Яндекс</a>В»</p></td><td width="50%"><p>ДизайнВ*—В*<a href="http://www.artlebedev.ru"onclick="c(this,17,1084)">Студия АртемияВ*Лебедева</a></p></td></tr></tbody></table><script type="text/javascript">if(self.parent.frames.length!=0) self.parent.location=document.location; else { var t=document.forms[0].text; try{t.type='search' }catch(e){}; t.focus() } setTimeout(function() { createElement('script', { type: 'text/javascript', charset:'UTF-8', src: 'http://www.yandex.ru/data/mail.js?yaru=y' }); }, 9);function AE(c, n, f) { c[n] = function(e) { return f(e || event); } } function $(id) { return document.getElementById(id); } function initSuggest() { var f = window.Suggest; if (f) { new f({ input: document.forms[0].text, noNavi: true, suggestUrl: 'http://suggest.yandex.ru/suggest-ya.cgi?ct=text/html&part=#{1}&v=2' }); suggest.status(true); } else { setTimeout(initSuggest, 100); } } window.loadSuggest = function() { if (!window.Suggest) { var text = document.forms[0].text; var parent = text.parentNode; var value = text.value; parent.focus(); parent.innerHTML = '<input id="text"type="search"name="text"autocomplete="off"size="50"maxlength="300">'; parent.firstChild.value = value; createElement('link', {rel: 'stylesheet', href: '/b-suggest.css'}); if(window.navigator.appName == 'Microsoft Internet Explorer'){ createElement('link', {rel: 'stylesheet', href: '/b-suggest-ie.css'}); } createElement('script', {type: 'text/javascript', src: 'http://suggest.yandex.ru/tsuggest-1.9.js'}); document.forms[0].text.focus(); setTimeout(initSuggest, 100); setTimeout(function(){document.forms[0].text.focus();}, 200); setTimeout(function(){document.forms[0].text.focus();}, 500); } }; setTimeout(loadSuggest, 100);</script></body></html>
    
     
Thread Status:
Not open for further replies.