Finding an IP address using Java (was: do u know?)

Reply

Join Date: Aug 2004
Posts: 8
Reputation: adityabakle is an unknown quantity at this point 
Solved Threads: 0
adityabakle adityabakle is offline Offline
Newbie Poster

Finding an IP address using Java (was: do u know?)

 
1
  #1
Aug 7th, 2004
How to get IP Address of all PC through java program
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 1,478
Reputation: mikeandike22 is an unknown quantity at this point 
Solved Threads: 18
mikeandike22's Avatar
mikeandike22 mikeandike22 is offline Offline
Nearly a Posting Virtuoso

Re: Finding an IP address using Java (was: do u know?)

 
0
  #2
Aug 8th, 2004
what do you mean for example i have a java script on one of my sites that tells the user visiting the site what there ip adress is. or are you trying to find all ur ip info cuz then you dont need a java program just goto run<cmd< type ipconfig all/. Or are u trying to build a java app that lets someone find ip info.


Tip:next time make your question clearer and make sure it makes sense
My Daniweb Blog: This,That, and Everything Else (Blog contest winner)

GetFirefox!
GetOpera!






Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: Finding an IP address using Java (was: do u know?)

 
1
  #3
Aug 8th, 2004
I tell you the way round ...

Process p = Runtime.Runtime().exec("ipconfig");

or just type another command for finding what computers are connected to your computer ( see net commands )

if you have linux or something .... write the commands over ipconfig.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 153
Reputation: cosi is an unknown quantity at this point 
Solved Threads: 1
cosi's Avatar
cosi cosi is offline Offline
Junior Poster

Re: Finding an IP address using Java (was: do u know?)

 
0
  #4
Aug 10th, 2004
The best way to obtain IP address is via the JDK's InetAddress
http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#getLocalHost()

This returns InetAddress which has many goodies you can play around with.

For example, You can do things like reverse domain name loook ups on arbitrary ipaddresses... or ip addresses from hostnames.
http://www.cs.ucl.ac.uk/staff/sjiang...ookup-test.htm

By the way Nice Runtime Trick nanosani... it doesn't work if the host is running a secure classloader though... or another OS withouth ipconfig for that matter. =\
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC