public void Prop_Rede()
throws UnknownHostException, SocketException
{
List list = new ArrayList();
System.out.println("Obtendo Informacões da Rede:");
InetAddress addr = InetAddress.getLocalHost();
byte[] ipAddr = addr.getAddress();
String hostname = addr.getHostName();
System.out.println("Nome do Computador completo: " + hostname);
InetAddress localHost = Inet4Address.getLocalHost();
NetworkInterface networkInterface = NetworkInterface.getByInetAddress(localHost);
System.out.println("Placa: " + networkInterface.getDisplayName());
try
{
System.out.println("Rede: " + NetworkInterface.getNetworkInterfaces().nextElement());
} catch (SocketException ex) {
Logger.getLogger(Propriedade_sistema.class.getName()).log(Level.SEVERE, null, ex);
}
try
{
Enumeration ifaces = NetworkInterface.getNetworkInterfaces();
while (ifaces.hasMoreElements()) {
NetworkInterface iface = (NetworkInterface)ifaces.nextElement();
System.out.println("Obtendo Informacões da interface: " + iface.getName());
for (InterfaceAddress address : iface.getInterfaceAddresses())
{
System.out.println("IP........: " + address.getAddress().toString());
Object bc = address.getBroadcast();
System.out.println("Broadcast.: " + bc);
System.out.println("Máscara...: " + address.getNetworkPrefixLength());
}
}
}
catch (SocketException ifaces)
{
ex.printStackTrace();
}
}
download do sitema de obter propriedades do PC aqui