944,179 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2109
  • Java RSS
Jun 8th, 2005
0

finding ip thru a java application

Expand Post »
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 ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nccliang is offline Offline
6 posts
since Jun 2005
Jun 8th, 2005
0

Re: finding ip thru a java application

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.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 9th, 2005
0

Re: finding ip thru a java application

here's the method:
Java Syntax (Toggle Plain Text)
  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. }
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 16th, 2005
0

Re: finding ip thru a java application

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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 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.
Message:
Previous Thread in Java Forum Timeline: Web Crawler
Next Thread in Java Forum Timeline: search and replace





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


Follow us on Twitter


© 2011 DaniWeb® LLC