java networking

Discussion in 'Programming' started by rajeeilan, Jun 16, 2009.

  1. #1
    dear all

    i have to get network node using java programming

    please help me:confused:
     
    rajeeilan, Jun 16, 2009 IP
  2. anandunics

    anandunics Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey man com on ..Tell me your problem clearly let me it for u
     
    anandunics, Jun 17, 2009 IP
  3. anandunics

    anandunics Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    import java.net.*;

    public class Ipaddress{
    public static void main(String args[]){
    try{
    InetAddress local= InetAddress.getLocalHost();
    System.out.println ("Local IP Address is : " + local);
    }
    catch (UnknownHostException e){
    System.err.println ("Can't detect IP Address : " + e);
    }
    }
    }


    Hope the above code ll fetch u the Node address
     
    anandunics, Jun 17, 2009 IP
  4. JavaPF

    JavaPF Member

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41