📄 urlinfo.java
字号:
import java.net.*;
import java.io.*;
import java.util.*;
public class URLInfo{
public static void main(String [] args){
URL theUrl =null;
try{
theUrl = new URL("http://www.bipt.edu.cn:80/index.htm");
}catch(MalformedURLException e){}
System.out.println("protocol is "+theUrl.getProtocol());
System.out.println("host is "+theUrl.getHost());
System.out.println("the File name is"+theUrl.getFile());
System.out.println("port is "+theUrl.getPort());
System.out.println("ref is "+theUrl.getRef());
System.out.println("Query is "+theUrl.getQuery());
System.out.println("path is "+theUrl.getPath());
System.out.println("the user information is "+theUrl.getUserInfo());
System.out.println("Authority is "+theUrl.getAuthority());
System.out.println(Calendar.getInstance().getTime().toString());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -