Switch to full style
Project under GPL source codes are posted here
Post a reply

Network Interface Adapter Info using Java APIs.

Thu Oct 16, 2008 7:17 pm

* Project Name:   Network Interface Adapter Info using Java API
* Programmer:   Cipson
* Type:   Network
* Technology:  Java
* IDE:   Any
* Description:   Network Interface/Adapter Info using Java APIs.

Code:
import java.net.*;
import java.util.*;

public class NetWorkInfo
{
public static void main(String args[])
{
  try{
    NetworkInterface ntAdapter = null;
    InetAddress inet = null;

    System.out.println("Network Interface Informations");
    Enumeration enum = NetworkInterface.getNetworkInterfaces();
    while(enum.hasMoreElements())
    {
    ntAdapter = (NetworkInterface)enum.nextElement();
    System.out.println("
Adapter Display Name :"
+ntAdapter.getDisplayName());
    System.out.println("Adapter Name : "+ntAdapter.getName());
    Enumeration e = ntAdapter.getInetAddresses();
    while(e.hasMoreElements())
    {
    inet = (InetAddress)e.nextElement();
    System.out.println("     IP Address : "+inet.getHostAddress() );
    }
    }
  }catch(Exception e){e.printStackTrace();}

}
}
 




Post a reply
  Related Posts  to : Network Interface Adapter Info using Java APIs.
 about Java IO-interface     -  
 java interface example     -  
 Free Work at Home Info Pack     -  
 Logging based on severity Level : INFO,Warning,ERROR,Debu     -  
 java abstract class,concrete class and interface     -  
 What is an Interface? !!!!     -  
 how to implement an interface     -  
 Iterator interface     -  
 Implement an interface in php     -  
 List interface     -  

Topic Tags

Java Networking