•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,489 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,693 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 26839 | Replies: 3
![]() |
•
•
Join Date: May 2004
Location: Boston,MA
Posts: 1,362
Reputation:
Rep Power: 7
Solved Threads: 17
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
Tip:next time make your question clearer and make sure it makes sense
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. =\
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. =\
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- finding IP address (Java)
- Thinking OOP!: From BASIC to JAVA (Java)
- [MERGED] Ip Address (C++)
- help required for implementing project using JAVA & XML (Java)
Other Threads in the Java Forum
- Previous Thread: Full Screen
- Next Thread: tcp-ip programming



Linear Mode