Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
FREE SEO Check & Google Maps Check for Sri Lankan Businesses | Web Design, Website Price Rs 14,900 |
LankaSolve
Updated:
Oct 20, 2026
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Oct 17, 2026
Hambantota
7 Acres Beachfront Land For Sell DownSouth , PerPerch Price 420 000
1024 Digital
Updated:
Oct 14, 2026
Baseus PI LITE INDOOR CAMERA
ErMurazor
Updated:
Oct 12, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
JAVA
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="akhilapraveen" data-source="post: 10765281" data-attributes="member: 104181"><p>MACHAN MAMA UMBATA WEBPAGE EKAK READ KARALA EKE TIYANA TEXT EKA GANNE KOHOMADA KIYALA KIYANNAM!</p><p></p><p>this is how you read a URL!!!</p><p></p><p><span style="color: Blue">import java.io.BufferedReader;</span></p><p><span style="color: Blue">import java.io.IOException;</span></p><p><span style="color: Blue">import java.io.InputStreamReader;</span></p><p><span style="color: Blue">import java.net.URL;</span></p><p><span style="color: Blue">import java.util.*;</span></p><p><span style="color: Blue">import java.io.*;</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue">public class ReadWebPage {</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> public String readnow(String txt){</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> String LINexxx="";</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> //String LINe="";</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> String txt1=txt;</span></p><p><span style="color: Blue"> try{</span></p><p><span style="color: Blue"> String urltext = txt1;</span></p><p><span style="color: Blue"> URL url = new URL(urltext);</span></p><p><span style="color: Blue"> BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));</span></p><p><span style="color: Blue"> String line = "";</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> while ((line = in.readLine()) != null){</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> // System.out.println(line);</span></p><p><span style="color: Blue"> String line1="";</span></p><p><span style="color: Blue"> //line1=in.readLine();</span></p><p><span style="color: Blue"> line1=line;</span></p><p><span style="color: Blue"> LINexxx=(LINexxx+"----------"+line1);</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> }</span></p><p><span style="color: Blue"> in.close();</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> return LINexxx;</span></p><p> <span style="color: Blue"></span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> }</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> catch (Exception e)</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> {</span></p><p><span style="color: Blue"> String Er="error is occured";</span></p><p><span style="color: Blue"> return Er;</span></p><p><span style="color: Blue"> //System.out.println(e.toString());</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> }</span></p><p><span style="color: Blue"> </span></p><p> <span style="color: Blue">}</span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue"> </span></p><p><span style="color: Blue">}</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue">pass the web address with http to readnow method!</span></p><p><span style="color: Blue">ex=http://www.google.lk/</span></p><p><span style="color: Blue"></span></p></blockquote><p></p>
[QUOTE="akhilapraveen, post: 10765281, member: 104181"] MACHAN MAMA UMBATA WEBPAGE EKAK READ KARALA EKE TIYANA TEXT EKA GANNE KOHOMADA KIYALA KIYANNAM! this is how you read a URL!!! [COLOR=Blue]import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.*; import java.io.*; public class ReadWebPage { public String readnow(String txt){ String LINexxx=""; //String LINe=""; String txt1=txt; try{ String urltext = txt1; URL url = new URL(urltext); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String line = ""; while ((line = in.readLine()) != null){ // System.out.println(line); String line1=""; //line1=in.readLine(); line1=line; LINexxx=(LINexxx+"----------"+line1); } in.close(); return LINexxx; } catch (Exception e) { String Er="error is occured"; return Er; //System.out.println(e.toString()); } } } pass the web address with http to readnow method! ex=http://www.google.lk/ [/COLOR] [/QUOTE]
Insert quotes…
Verification
Payakata winadi keeyak tibeda?
Post reply
Top
Bottom