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);
}
}
}
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
Post a Comment