URLDownloadToFile



  • die >> waren ein kleiner Tippfehler im programm, deshalb die fehlermeldungen 😃

    jetzt giebt die Funktion zwar etwas zurück, allerdings den Wert -2146697203, mit dem ich schonmal so gar nichts anfangen kann.

    Wenn ich den Code von Draco verwende muss wohl ein nicht defifierter Case eingetreten sein da das Programm einfach gar nichts ausgibt.

    edit: falls ich es noch nicht gesagt haben sollte, ich verwende Windows XP und Microsoft Visual C++ 2008 Express Edition



  • Probier mal, der Internetadresse "http://" mitzugeben.



  • danke, jetzt downloadet er immerhin schonmal was^^

    aber in der textdatei in die er es schreibt steht jetzt folgendes:

    <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>window.google={kEI:"BdYBSuaPOo2ysAbg_JG3BA",kEXPI:"17259,20257,30333",kHL:"de"};
    window.google.sn="webhp";window.google.timers={load:{t:{start:(new Date).getTime()}}};try{window.google.pt=window.gtbExternal&&window.gtbExternal.pageT()||window.external&&window.external.pageT}catch(b){}
    window.google.jsrt_kill=1;
    var _gjwl=location;function _gjuc(){var b=_gjwl.href.indexOf("#");if(b>=0){var a=_gjwl.href.substring(b+1);if(/(|&)q=/.test(a)&&a.indexOf("#")==-1&&!/(|&)cad=h($|&)/.test(a)){_gjwl.replace("/search?"+a.replace(/(|&)fp=[&]/g,"")+"&cad=h");return 1}}return 0}function _gjp(){!(window._gjwl.hash&&window._gjuc())&&setTimeout(_gjp,500)};
    window._gjp && _gjp();</script><style>body,td,a,p,.h{font-family:arial,sans-serif}.h{color:#36c;font-size:20px}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}#gbar{height:22px;padding-left:2px}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbi,#gbs{background:#fff;left:0;position:absolute;top:24px;visibility:hidden;z-index:1000}#gbi{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}#guser{padding-bottom:7px !important;text-align:right}#gbar,#guser{font-size:13px;padding-top:1px !important}@media all{.gb1,.gb3{height:22px;margin-right:.73em;vertical-align:top}#gbar{float:left}}.gb2{display:block;padding:.2em .5em}a.gb1,a.gb2,a.gb3{color:#00c !important}.gb2,.gb3{text-decoration:none}a.gb2:hover{background:#36c;color:#fff !important}</style><script>google.y={};google.x=function(e,g){google.y[e.id]=[e,g];return false};window.clk=function(b,c,d,e,f,g,h){if(document.images){var a=encodeURIComponent||escape;(new Image).src=["/url?sa=T",c?"&oi="+a(c):"",d?"&cad="+a(d):"","&ct=",a(e||"res"),"&cd=",a(f),b?"&url="+a(b.replace(/#.
    /,"")).replace(/\+/g,"%2B"):"","&ei=","BdYBSuaPOo2ysAbg_JG3BA",g].join("")}return true};
    window.gbar={qs:function(){},tg:function(e){var o={id:'gbar'};for(i in e)o[i]=e[i];google.x(o,function(){gbar.tg(o)})}};</script></head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onload="document.f.q.focus();if(document.images)new Image().src='/images/nav_logo4.png'" topmargin=3 marginheight=3><textarea id=csi style=display:none></textarea><div id=gbar><nobr><b class=gb1>Web</b> <a href="http://images.google.de/imghp?hl=de&tab=wi" onclick=gbar.qs(this) class=gb1>Bilder</a> <a href="http://maps.google.de/maps?hl=de&tab=wl" onclick=gbar.qs(this) class=gb1>Maps</a> <a href="http://news.google.de/nwshp?hl=de&tab=wn" onclick=gbar.qs(this) class=gb1>News</a> <a href="http://video.google.de/?hl=de&tab=wv" onclick=gbar.qs(this) class=gb1>Video</a> <a href="http://mail.google.com/mail/?hl=de&tab=wm" class=gb1>E-Mail</a> <a href="http://www.google.de/intl/de/options/" onclick="this.blur();gbar.tg(event);return !1" aria-haspopup=true class=gb3><u>Mehr</u> <small>▼</small></a><div id=gbi><a href="http://www.google.de/prdhp?hl=de&tab=wf" onclick=gbar.qs(this) class=gb2>Shopping</a> <a href="http://groups.google.de/grphp?hl=de&tab=wg" onclick=gbar.qs(this) class=gb2>Groups</a> <a href="http://books.google.de/bkshp?hl=de&tab=wp" onclick=gbar.qs(this) class=gb2>Bücher</a> <a href="http://blogsearch.google.de/?hl=de&tab=wb" onclick=gbar.qs(this) class=gb2>Blogs</a> <a href="http://translate.google.de/?hl=de&tab=wT" onclick=gbar.qs(this) class=gb2>Übersetzer</a> <div class=gb2><div class=gbd></div></div><a href="http://www.youtube.com/?hl=de&tab=w1&gl=DE" onclick=gbar.qs(this) class=gb2>YouTube</a> <a href="http://www.google.com/calendar/render?hl=de&tab=wc" class=gb2>Kalender</a> <a href="http://picasaweb.google.de/home?hl=de&tab=wq" onclick=gbar.qs(this) class=gb2>Fotos</a> <a href="http://docs.google.com/?hl=de&tab=wo" class=gb2>Text & Tabellen</a> <a href="http://www.google.de/reader/view/?hl=de&tab=wy" class=gb2>Reader</a> <a href="http://sites.google.com/?hl=de&tab=w3" class=gb2>Sites</a> <div class=gb2><div class=gbd></div></div><a href="http://www.google.de/intl/de/options/" class=gb2>und noch mehr »</a> </div></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><div align=right id=guser style="font-size:84%;padding:0 0 4px" width=100%><nobr><a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.de/ig%3Fhl%3Dde%26source%3Diglk&usg=AFQjCNFjfPavRPBJrOKJS3MB2uzhpfN6zw">iGoogle</a> | <a href="https://www.google.com/accounts/Login?continue=http://www.google.de/&hl=de">Anmelden</a></nobr></div><center><br clear=all id=lgpd><img alt="Google" height=110 src="/intl/de_de/images/logo.gif" width=301><br><br><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%> </td><td align=center nowrap><input name=hl type=hidden value=de><input autocomplete="off" maxlength=2048 name=q size=55 title="Google-Suche" value=""><br><input name=btnG type=submit value="Google-Suche"><input name=btnI type=submit value="Auf gut Glück!"></td><td nowrap width=25%><font size=-2>  <a href=/advanced_search?hl=de>Erweiterte Suche</a><br>  <a href=/preferences?hl=de>Einstellungen</a><br>  <a href=/language_tools?hl=de>Sprachtools</a></font></td></tr><tr><td align=center colspan=3><font size=-1><span style="text-align:left">Suche: <input id=all type=radio name=meta value="" checked><label for=all> Das Web </label><input id=lgr type=radio name=meta value="lr=lang_de"><label for=lgr> Seiten auf Deutsch </label><input id=cty type=radio name=meta value="cr=countryDE"><label for=cty> Seiten aus Deutschland </label></span></font></td></tr></table></form><br><style>#cpc td{font-size:80%}</style><table id=cpc><td><img src="/help/hc/images/chrome32.gif"><td><b>Testen Sie Google Chrome</b> − schneller im Internet unterwegs<td><a href="/aclk?sa=L&ai=Cxt1YaNQBSp6FHoqrsAaMno3rDdu31oABy_-ZvgvB2ZzZExABIMFUUJnDkaX5_____wFglQKqBAlP0GlSqVQKgt8&num=1&sig=AGiWqtwwCdvoBbIMiGrU0tIitVWQPVrEdw&q=http://www.google.com/chrome/index.html%3Fhl%3Dde%26brand%3DCHNG%26utm_source%3Dde-hpp%26utm_medium%3Dhpp%26utm_campaign%3Dde"><b>Jetzt installieren</b></a>.</table><br><font size=-1><a href="/intl/de/ads/">Werben mit Google</a> - <a href="/services/">Unternehmensangebote</a> - <a href="/intl/de/about.html">Über Google</a> - <a href=http://www.google.com/ncr>Google.com in English</a><p id=shf0 style=display:none;behavior:url(#default#homePage)><font size=-1><a href="/aclk?sa=L&ai=CYJYDXNMBSqyaM4KrsAa0rLS2DsX4n3zrqKHHCs2tk5cREAEgwVRQvpyhyfj_____AWApqgQJT9BLSQMlL072&num=1&sig=AGiWqtzktoszoRuqpcslPNR5AGOG3djgbQ&q=/mgyhp.html" onclick=xz()>Google zu meiner Startseite machen</a></p><script>(function(){var a=document.getElementById("shf0"),b="http://www.google.de/";try{a.isHomePage(b)||(a.style.display="block")}catch(z){}window.xz=function(){try{a.setHomePage(b);var c=new Image;c.src="/gen_204?mgmhp=shf0&ct=c&cd="+a.isHomePage(b);window.wy=c}catch(z){}}})();</script></font><p><font size=-2>©2009 - <a href="/intl/de/privacy.html">Datenschutz</a></font></p></center><div id=xjsd><script>if(google.y)google.y.first=[];google.dstr=[];google.rein=[];window.setTimeout(function(){var xjs=document.createElement('script');xjs.src='/extern_js/f/CgJkZRICZGUrMAo4GywrMA44BSwrMBY4CSwrMBc4ASwrMBg4BCwrMCU4yYgBLCswJjgELCswJzgALA/w9w3JMm1gvA.js';(document.getElementById('xjsd') || document.body).appendChild(xjs)},0);;google.y.first.push(function(){google.ac.i(document.f,document.f.q,'','')})</script></div><script>(function(){
    function a(){google.timers.load.t.ol=(new Date).getTime();google.report&&google.report(google.timers.load,{ei:google.kEI,e:google.kEXPI})}if(window.addEventListener)window.addEventListener("load",a,false);else if(window.attachEvent)window.attachEvent("onload",a);google.timers.load.t.prt=(new Date).getTime();
    })();
    </script>

    ist das normal?

    edit: hat sich erledigt, statt txt habe ich einfach C:\\test.htm angegeben 😃

    danke nochmal für die Hilfe,
    Andreas.


  • Administrator

    1. -2146697203 entspricht INET_E_DOWNLOAD_FAILURE, also hätte die Switch-Case Sache funktionieren müssen. Wahrscheinlich hast du wieder einen Schreibfehler gemacht. Pass doch mal ein wenig auf, was du schreibst 😉
    2. Klar ist das normal. Was hast du denn erwartet? Das ist der HTML Quellcode von der Googleseite. Nimm einen Browser und öffne den Quelltext von www.google.de, dann wirst du das gleiche sehen.

    Grüssli



  • Was hast du erwartet? Etwa sowas?

    Hier oben ist die Toolbar mit Web, Bilder, Maps, etc.
    Darunter steht zentriert das Google Deutschland Logo.
    Dann folgt das Eingabefeld und die Buttons "Google-Suche" 
    und "Auf gut Glück!"
    ...
    

    Nein, es interessiert mich wirklich. Was hast du erwartet zu bekommen, wenn du Google herunterlädst? Etwa eine Offline-Version der Suchmaschine, die du privat benutzen kannst? 😃

    EDIT: Sorry, hatte Draveres Post nicht gesehen.

    Gruß
    Don06



  • hat sich erledigt, ich hab einfach de Pfad von C:\\test.txt auf C:\\test.htm geändert.

    jetzt hat ers als webpage gespeichert.

    was den Code von Draco betrifft:

    den habe ich einfach aus dem Forum kopiert und eingefügt, tippfehler ausgeschlossen^^

    aber ist ja auch egal, hauptsache es funktioniert 😃

    edit:

    was hast du denn erwartet?

    genau genommen hatte ich erwartet, dass er es automatisch als website wie die .htm speichert, aber mit dem neuen Pfad tut er das ja jetzt .

    nochmal danke an alle, die mir geholofen haben,
    Andreas.


Anmelden zum Antworten