IP Finder

package ıpfinder;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Nurhak
 */
public class IPFinder {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        InetAddress ia;
        try {
            ia = InetAddress.getLocalHost();
            String pcName = ia.getHostName();
            String pcIp = ia.getHostAddress();

            System.out.println("PcName: "+pcName + " & Pc IP: " + pcIp);
        } catch (UnknownHostException ex) {
            Logger.getLogger(IPFinder.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}

Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"