LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2011, 06:07 AM   #1
pelletibharath
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Java Program to Display All IP Addresses in LAN


Hi Sir, I Want to Develop Network Scanner Software. For that i need "Java Program to Display All IP Addresses in LAN". Please, any one help me......
 
Old 02-25-2011, 06:25 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Before people start bashing you here I would like to state that this is NOT the way
LQ goes, you need to SHOW your efforts, through code or through algorithms, what you have
read till now and where you are stuck etc.

Welcome to LQ.
 
Old 02-28-2011, 01:57 AM   #3
pelletibharath
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
java program to display all ip addresses in lan

import java.util.*;
import java.lang.*;
import java.net.*;

public class GetOwnIP
{
public static void main(String args[]) {
try{
InetAddress ownIP=InetAddress.getLocalHost();
System.out.println("IP of my system is := "+ownIP.getHostAddress());
}catch (Exception e){
System.out.println("Exception caught ="+e.getMessage());
}
}
}

This code shows only my system IP address.But, i want to display all systems IP addresses connected in my LAN Network. Please help me with code....
 
Old 03-01-2011, 12:49 PM   #4
Niartov
LQ Newbie
 
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Do you know the Network Range you are on. If not you would need to get your subnet to calculate the ip range. After you know the range you are looking for you can check out the link for icmp pinging. This might not work if firewalls don't allow ICMP responses.



http://www.0x13.de/index.php/code-sn...g-in-java.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Program to Display IP Address and Host Names in Wireless mahesh270 Programming 7 02-25-2011 09:45 AM
Different MAC addresses for same LAN card bhupeshchawda Linux - Networking 3 03-26-2007 05:50 PM
find ip addresses on lan allelopath Linux - Networking 9 05-03-2006 09:14 AM
Conflicting IP addresses in LAN? Joe Soap Linux - Networking 2 05-05-2005 05:36 PM
KDE Lan Browser doesn't display available LAN computers dance2die Linux - Newbie 2 01-16-2005 09:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration