[java]代码库
import java.net.*;
import java.io.*;
public class ParseURL {
public static void main (String [] args) throws Exception {
URL Aurl = new URL ("http://http://yuncode.net/list/java/");
URL tuto = new URL (Aurl, "tutorial.intro.html#DOWNLOADING");
System.out.println ("protocol=" + tuto.getProtocol() );
System.out.println ("host =" + tuto.getHost() );
System.out.println ("filename=" + tuto.getFile() );
System.out.println ("port=" + tuto.getPort() );
System.out.println ("ref=" + tuto.getRef() );
System.out.println ("query=" + tuto.getQuery() );
System.out.println ("path=" + tuto.getPath() );
System.out.println ("UserInfo=" + tuto.getUserInfo() );
System.out.println ("Authority=" + tuto.getAuthority() );
}
}