![]() |
| ||
| Finding an IP address using Java (was: do u know?) How to get IP Address of all PC through java program |
| ||
| 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 |
| ||
| 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. |
| ||
| 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. =\ |
| All times are GMT -4. The time now is 6:50 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC