<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Die Tipps-Datenbank &#187; Java</title>
	<atom:link href="http://www.tipps-datenbank.net/internet-und-computer-tipps/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tipps-datenbank.net</link>
	<description>Hilfe für jeden</description>
	<lastBuildDate>Sun, 08 Aug 2010 12:03:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Webseite runterladen mit Java</title>
		<link>http://www.tipps-datenbank.net/java/webseite-runterladen-mit-java/</link>
		<comments>http://www.tipps-datenbank.net/java/webseite-runterladen-mit-java/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:30:20 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.tipps-datenbank.net/?p=298</guid>
		<description><![CDATA[

Gerade habe ich f&#252;r die Schule einen kleinen Javacode geschrieben, welcher eine Webseite im Internet ausliest und in der Konsole ausgibt. Da ich euch diesen Code nat&#252;rlich nicht vorenthalten m&#246;chte, poste ich ihn kurz hier rein. Da er kommentiert ist, werde ich ihn heute Mal nicht erkl&#228;ren. Wer Fragen dazu hat, kann sich per Kommentar [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Gerade habe ich f&#252;r die Schule einen kleinen Javacode geschrieben, welcher eine Webseite im Internet ausliest und in der Konsole ausgibt. Da ich euch diesen Code nat&#252;rlich nicht vorenthalten m&#246;chte, poste ich ihn kurz hier rein. Da er kommentiert ist, werde ich ihn heute Mal nicht erkl&#228;ren. Wer Fragen dazu hat, kann sich per Kommentar melden.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> 
<span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>, <span style="color: #003399;">UnknownHostException</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Erstellt die URL</span>
<span style="color: #003399;">URL</span> url <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.tipps-datenbank.net/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Läd Webseite vom Server</span>
<span style="color: #003399;">BufferedReader</span> buffer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>url.<span style="color: #006633;">openStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> line<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Gibt Webseite Zeilenweise aus</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>line <span style="color: #339933;">=</span> buffer.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
buffer.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Fängt Fehler ab</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">MalformedURLException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.tipps-datenbank.net/java/webseite-runterladen-mit-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
