⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlinfo.java

📁 java课件及例程有一些PPT及一些例程
💻 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 + -