Total members 11892 |It is currently Fri Oct 18, 2024 9:11 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka






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

}
}
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Network Interface Adapter Info using Java APIs.
 java interface example     -  
 about Java IO-interface     -  
 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? !!!!     -  
 Implement an interface in php     -  
 List interface     -  
 how to implement an interface     -  
 Iterator interface     -  



Topic Tags

Java Networking







Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com