IPターゲットコンピュータ
lnetAddress
ポートポジショニングソフトウェア
1.ソフトウェアを区別する
TCPの2の2バイトUDP 0-65535
3.プロトコルポートと競合しない
4.ポート番号良く
認識ポート部80 HTTPプロトコルを理解する8080 Tomcatサーバー443 HTTPSプロトコル1521Oracle 3306 MYSQL
lnetScokerAddress
1.コンストラクタ
new lnetScokerAddress(域名|地址,端口)
2.方法
getAddress()//获取地址
getport()//获取端口
すべてのリソース内のURL測位ソフトウェア
URL:ユニフォームリソースロケータ(ユニバーサルリソースロケータ)、インターネットの3個の礎石の一つ(HTML、HTTP)
https://www.baidu.com:443/index.html?uname=shsxt&age=18#a
1.プロトコル:HTTPS
2.ドメイン、コンピューター:www.baidu.com
3.ポート(デフォルト80):443
4.要求されたリソースのindex.htmlのuname = shsxt&年齢= 18 ?
パラメータ:のuname = shsxt&年齢= 18の
アンカー:A
package 网络编程开篇;
import java.net.MalformedURLException;
import java.net.URL;
public class urltest {
public static void main(String[] args) throws MalformedURLException {
URL url =new URL("https://www.baidu.com:443/index.html?uname=shsxt&age=18#a");
System.out.println("协议"+url.getProtocol());
System.out.println("域名ip"+url.getHost());
System.out.println("端口"+url.getPort());
System.out.println("请求资源"+url.getPath());
System.out.println("请求资源"+url.getFile());
System.out.println("参数"+url.getQuery());
System.out.println("锚点"+url.getRef());
}
}