View Single Post
Old Aug 11th, 2004, 10:45 PM   #5
mangudai_gb
Newbie
 
Join Date: Aug 2004
Posts: 3
Rep Power: 0 mangudai_gb is on a distinguished road
I have got another problem....

import java.net.*;
import java.io.*;

public class SourceViewer {
  public static void main (String args[]){
	if (args.length>0){
   try{
 URL u=new URL(args[0]);
 URLConnection uc = u.openConnection();
 InputStream in = uc.getInputStream();
 in = new BufferedInputStream(in);
 Reader r = new InputStreamReader(in);
 int c;
 while((c = r.read()) != -1){
   System.out.print((char) c);
 }
   }
   catch (MalformedURLException e) {
 System.err.println(args[0] + "is not a parseable URL");
   }
   catch (IOException e) {
 System.err.println(e);
   }
	}
  }

when i run this code in Fedora 1 i get a "UnKnownHost" error......can u help me in fixing it?????
mangudai_gb is offline   Reply With Quote