cs_Romuald
Messages postés172Date d'inscriptionlundi 30 avril 2001StatutMembreDernière intervention 6 avril 2003 23 juil. 2002 à 09:59
Si tu es sous MacOS X tu peux faire un ifconfig -l pour avoir la liste des interfaces et leurs IP (sur un réseau local, je ne sais pas si ça marche par exemple en ADSL/RTC)
En Java tu peux faire :
java.net.InetAddress.getLocalHost();
Exemple simple :
public class Adresseip
{
public static void main(String argds[]) {
try {
System.out.println(java.net.InetAddress.getLocalHost().t
oString());
}
catch (java.net.UnknownHostException err) {}
}
}