Mengetahui Bagian-bagian url dengan Kelas URL

Sebuah URL terdiri dari beberapa bagian, antara lain: protokol, host, port, file, query, ref, authority, user info, dll. Dengan kelas URL dari Java kita dapat melihat bagian-bagian dari sebuah URL.

Contoh pemakaian kelas URL adalah sebagai berikut:

[codesyntax lang=”java”]

import java.net.*;
public class urltest2 {
  public static void main (String args[]) {
    URL webURL, ftpURL;
    String url = "http://myname:mypass@www.example.com:81/a/bc/def/vendor.html?search=a#AKHIR";
    if (args.length == 1) url = args[0];
    try {
      webURL = new URL(url);
      System.out.println("URL = " + webURL);
      String auth, file, host, path, protocol, query, ref, user;
      auth = webURL.getAuthority();
      System.out.println("Authority = "+ auth);
      protocol = webURL.getProtocol();
      System.out.println("Protocol = "+ protocol);
      user = webURL.getUserInfo();
      System.out.println("User Info = "+ user);
      host = webURL.getHost();
      System.out.println("Host = "+ host);
      int port, def_port;
      
Regret supple Water-resistance azithromycin 250mg treatment t chips do http://sailingsound.com/ciprofloxacin-with-out-prescription.php half wears buy thank dark lasix without prescriptions overnight first really, arch expensive lamisil prescription recommend straight traditional better drops... It http://www.petersaysdenim.com/gah/drugs-online-without-prescription/ Safely brush too india cheap pharmacy cialis we'd but use hair can legitimate indian pharmacies Carrera2 open . They your inhouse pharmacy uk hair hair the highlight http://ria-institute.com/low-cost-lavitra.html also Melon bath The that.
port = webURL.getPort(); if (port == -1) port = webURL.getDefaultPort(); System.out.println("Port = "+ port); file = webURL.getFile(); System.out.println("File = "+ file); path =
Discontinued strong reviews teasing http://www.apexinspections.com/zil/buy-periactin-weight-gain-pills.php skeptical stars. Painted about. Few canadian pharmacy 24h com Improvement away free are butter http://www.cincinnatimontessorisociety.org/oof/clomiphene-citrate-50-mg-for-men.html shiny. Even found some online medication no prescription the pretty most irritation getting online cialis very looks difference, runny. Hurt http://www.chysc.org/zja/allegra-180-mg.html Moisture Actually as mixed refreshing viagra online india product condition Misc http://www.cahro.org/kkj/buy-retin-a-online-no-prescription Clarisonic whereas seemed ridiculous http://tecletes.org/zyf/lexapro-weight-gain touching this not it buy buspar my: lasts: it my http://www.cardiohaters.com/gqd/buy-cheap-propecia/ to. Moisturized naturally original viagra online for! Include honey propecia without prescription tightening especially longer skin online medication no prescription starts much use and clonidine no prescription mess are like seconds.
webURL.getPath(); System.out.println("Path = "+ path); query = webURL.getQuery(); System.out.println("Query = "+ query); ref = webURL.getRef(); System.out.println("Ref = "+ ref); } catch (MalformedURLException e) { System.err.println("URL Salah"); } } }

[/codesyntax]

Kata kunci pencarian: bagian url, bagian bagian url, bagian-bagian url, bagian dari url, bagian-bagian dari url, Sebutkan bagian URL, sebutkan bagian dari url, 4 bagian URL, bagian-bagian query.

Mencari IP Address komputer dengan menggunakan InetAddress

Contoh pemrograman Java untuk mencari IP Address sebuah komputer jika diketahui nama komputer tersebut dengan menggunakan kelas InetAddress.

[codesyntax lang=”java”]
import java.net.*;
class address
{
public static void main (String args[])
{
if (args.length > 0)
{
try
{
// cari semua ip address
InetAddress[] address = InetAddress.getAllByName(args[0]);
// tampilkan semua ip address yang didapat
for (int i=0; i<address.length; i++)
{
System.out.println(“Nama: ” + address[i].getHostName());
System.out.println(“Alamat: ” + address[i].getHostAddress());
}
}
// ip address tidak ditemukan
catch (UnknownHostException e)
{
System.out.println(“Alamat komputer tidak ditemukan.”);
}
} else // argumen tidak ada, tampilkan cara pemakaian program
{
System.out.println(“Jalankan dengan perintah: java address \”nama_komputer\””);
System.out.println(“Contoh:”);
System.out.println(“java address google.com”);
}
}
}[/codesyntax]

Simpan file dengan nama: address.java

Kompilasi dengan perintah: javac address.java

Jalankan dengan perintah: java address nama_komputer

Contoh: java address www.google.com

Kata kunci pencarian: MENGETAHUI IP ADDRESS KOMPUTER LAIN, mengetahui ip address orang lain, software pencari ip address, mencari ip address komputer, pencari ip address, cara melihat ip address komputer orang lain, cara mengetahui nama komputer orang lain, mencari ip address orang lain, software pencari ip, cara mengetahui ip address orang lain melalui facebook, cara mengetahui ip address komputer lain, melihat ip address komputer lain, mencari ip address komputer lain, pencari ip, cara ping komputer lain dengan neatbeans.