Java网络编程之URI、URL研究专题五(2)

文章作者 100test 发表时间 2007:03:14 16:30:40
来源 100Test.Com百考试题网


url url = new url (args [0]).

system.out.println ("authority = " url.getauthority ()).

system.out.println ("default port = " url.getdefaultport ()).

system.out.println ("file = " url.getfile ()).

system.out.println ("host = " url.gethost ()).

system.out.println ("path = " url.getpath ()).

system.out.println ("port = " url.getport ()).

system.out.println ("protocol = " url.getprotocol ()).

system.out.println ("query = " url.getquery ()).

system.out.println ("ref = " url.getref ()).

system.out.println ("user info = " url.getuserinfo ()).

system.out.print (’\n’).

inputstream is = url.openstream ().

int ch.

while ((ch = is.read ()) != -1)

system.out.print ((char) ch).

is.close ().

相关文章


Java是传值还是传引用?
Java网络编程之URI、URL研究专题五(2)
Java网络编程之URI、URL研究专题五(1)
Java网络编程之URI、URL研究专题三(1)
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛