java中讲讲URL的用法,举例?


马克-to-win:URL(Uniform Resource Locator-----一致资源查找器)它用来指向Internet上的资源文件,比如http://java.sun.com:8080/docs/introdiction.htmnet包中的URL类提供API来访问Internet上的信息。
比如以上的URL中:
1)协议:http
2)IP 地址或主机名:java.sun.com
3)端口号:8080
4)实际文件路径:docs/introdiction.htm例:2.4.1
/*no need to have network through to run the program.*/
import java.net.*;
import java.io.*;
public class TestMark_to_win {
    public static void main(String[] args) throws Exception {

详情黏贴以下网址在地址栏后请进:http://www.mark-to-win.com/JavaBeginner/JavaBeginner9_web.html#URLExample

猜你喜欢

转载自blog.csdn.net/mark_to_win/article/details/71056172
今日推荐