InetAddress and applet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   matthew_magliocca
Posted On:   Friday, June 28, 2002 05:04 PM

Quick question:
Does anyone know if you can accquire the localhost address of a computer through an Inetaddress method activated by sn applet running in a browser.
In other words:
Computer open applet in browser
Applet tries to get computers InetAddress
Then sends it to Servlet
Can we do that?

Re: InetAddress and applet

Posted By:   Xu_jianfeng  
Posted On:   Wednesday, July 3, 2002 11:11 PM

add the code in your applet code:
String strServerIP = getCodeBase().getHost();InetAddress address = InetAddress.getByName(strServerIP);
Now the address is the ip address that the server that supplys the applet.
About | Sitemap | Contact