public class NetUrlCreat {
public static void main(String[] args) {
try {
URL url = new URL("ftp://210.22.192.130/youxi/lygame-rpg-?色幻想.exe");
// URI uri = new URI("file://D:/allright-email-table.xls");
System.out.println(URLEncoder.encode("?色幻想"));
String protocol = url.getProtocol(); // http
String host = url.getHost(); // hostname
int port = url.getPort(); // 80
String file = url.getFile(); // index.html
String ref = url.getRef(); // _top_
System.out.println(protocol);
System.out.println(host);
System.out.println(ref);
System.out.println(file);
BufferedReader in =
new BufferedReader(new InputStreamReader(url.openStream()));
String str;
String text = "";
while ((str = in.readLine()) != null) {
System.out.println(str);
}
in.close();