finding ip thru a java application

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2005
Posts: 6
Reputation: nccliang is an unknown quantity at this point 
Solved Threads: 0
nccliang nccliang is offline Offline
Newbie Poster

finding ip thru a java application

 
0
  #1
Jun 8th, 2005
hi guys , i have a query
if some group of people are using the same java application and are connected via LAN . It is like in the java application , i want to expose other people ip address , so that i am able to send message via LAN .
you guys got any idea how shd i code it ?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: finding ip thru a java application

 
0
  #2
Jun 8th, 2005
Look up the InetAddress class:

http://java.sun.com/j2se/1.4.2/docs/...etAddress.html

There should be a method in there that suits your needs.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: finding ip thru a java application

 
0
  #3
Jun 9th, 2005
here's the method:
  1. try {
  2. InetAddress inetAdd =
  3. InetAddress.getByName(input.getText());
  4. output.setText(inetAdd.getHostAddress());
  5. }
  6. catch (Exception e1)
  7. {
  8. output.setText("ERROR");
  9. }
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: finding ip thru a java application

 
0
  #4
Jun 16th, 2005
Hi everyone,

You can see the below three links. They come with sample codes and examples

http://javaalmanac.com/egs/java.net/GetHostname.html

http://javaalmanac.com/egs/java.net/...ame.html?l=rel

http://javaalmanac.com/egs/java.net/Local.html?l=rel

I hope this helps you

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Reply

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




Views: 1865 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC