Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , ,

Sponsored Links


List the IP addresses

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-01-2010
Member
 
Join Date: Dec 2009
Posts: 263
List the IP addresses

Sponsored Links
Hello
I would like to know if there is a way to list the IP addresses on a local network in Java. I was trying some of the programs, but I do not know is it possible in java or not? Even I an a new bee in java. So, any help will be highly appreciated. Thanks in advance.

Reply With Quote
  #2  
Old 29-01-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,278
Re: List the IP addresses

Hi,
You can do a broadcast ping (assuming it is approved by the administrator) and see what comes out (assuming that the machines are configured to respond to broadcast ping, assuming that packets are not lost ). Look at the doc ping; may need to pass the -b option. I think this should not be difficult for you.
Reply With Quote
  #3  
Old 29-01-2010
Member
 
Join Date: Dec 2009
Posts: 263
Re: List the IP addresses

Hello,
Thank you I'll try, apparently there is no solution in Java. I started a little in this area but how it works in general to find machines on a network if someone has a link that explains or can point me to a tutorial or a course that I assimilate the knowledge I need it would be cool. Still, I will try some more codes in java, so that I can get an over view of the concept of the networking in java.
Reply With Quote
  #4  
Old 29-01-2010
Member
 
Join Date: Dec 2009
Posts: 211
Re: List the IP addresses

Hi,
Even I have a similar kind of a problem. In fact I try to write a small Java program that allows me to transfer files between my PC (which are under different OSes) and I'd like the program to find the only PC on the network without my am obliged to enter the IP address myself. Even I am new to java, so please if you have any example which will explain me briefly, til will good for me. Thanks in advance.
Reply With Quote
  #5  
Old 29-01-2010
Member
 
Join Date: May 2008
Posts: 2,000
Re: List the IP addresses

Hello,
For a list of computers connected to the LAN, it is simply impossible in general, it is necessary that the computers work together in a way or another:
- either by registering somewhere (for example, if the network uses DHCP, perhaps the DHCP server can give you a list)
- is being referenced by an administrator (look in / etc / hosts file, or files of definitions of DNS if it is a DNS server for LAN)
- is responding to requests broadcast or multicast (all of a sudden he comes back that there is a multicast group all-hosts, "244.0.0.1, including LAN computers are auto part [1]).
Hope this information will help you.
Reply With Quote
  #6  
Old 29-01-2010
opaper's Avatar
Member
 
Join Date: May 2008
Posts: 2,371
Re: List the IP addresses

Hello,
Here is a small example code which will give you the client IP address.
Code:
import java.net.*;
import java.io.*;
import java.applet.*;

public class getipextends Applet {
  public void init() {
    try {
     InetAddress ip =
        InetAddress.getLocalHost();
     System.out.println("IP:"+ip.getHostAddress());
     }
    catch(Exception e) {
     e.printStackTrace();
     }
    }
}
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "List the IP addresses"
Thread Thread Starter Forum Replies Last Post
How to NAT several public addresses HarshaB Networking & Security 5 13-01-2010 09:59 AM
Extending IP addresses Gunner 1 Networking & Security 5 26-12-2009 10:39 AM
Storing MAC addresses in AD boris52 Active Directory 4 27-07-2009 10:57 PM
How to remove email addresses in entourage drop down list Renderman21 Windows Software 3 25-06-2009 11:49 AM
Is there a way to query a DHCP server to get a list of MAC addresses? mike_z@excite.com Windows Server Help 7 24-02-2006 07:16 PM


All times are GMT +5.5. The time now is 02:12 PM.