123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Network Interface/Adapter Info using Java APIs.

--------------------------------------------------------------------------------

Description : Network Interface/Adapter Info using Java APIs.

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();}

}

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG