943,502 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 55673
  • Java RSS
Aug 7th, 2004
0

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

Expand Post »
How to get IP Address of all PC through java program
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
adityabakle is offline Offline
8 posts
since Aug 2004
Aug 8th, 2004
0

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

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
Reputation Points: 33
Solved Threads: 19
Nearly a Posting Virtuoso
mikeandike22 is offline Offline
1,496 posts
since May 2004
Aug 8th, 2004
1

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

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.
Team Colleague
Reputation Points: 45
Solved Threads: 56
Unauthenticated Liar
nanosani is offline Offline
1,767 posts
since Jul 2004
Aug 10th, 2004
0

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

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. =\
Reputation Points: 17
Solved Threads: 1
Junior Poster
cosi is offline Offline
153 posts
since Aug 2004
Dec 28th, 2009
0
Re: Finding an IP address using Java (was: do u know?)
How to discover the local area network in java?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
divakar.durai is offline Offline
1 posts
since Dec 2009
Dec 28th, 2009
0
Re: Finding an IP address using Java (was: do u know?)
How to discover the local area network in java?
By reading above replies and not asking general questions...
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,653 posts
since Dec 2004
Jun 11th, 2010
-1
Re: Finding an IP address using Java (was: do u know?)
How to find the class of an ip address? please provide me a code in java or c++.......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abhinay1111 is offline Offline
2 posts
since Jun 2010
Jun 11th, 2010
0
Re: Finding an IP address using Java (was: do u know?)
How to find the class of an ip address? please provide me a code in java or c++.......
Please read previous replies and in the future do not ask question in old thread that already have answer to it

If you have more specific questions then demanding code you are more then welcome to create new thread. As of now thread is closed
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,653 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: Advanced problem: image flickers once and then disappears - portability issue
Next Thread in Java Forum Timeline: making a screen saver





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC