简体   繁体   English

如何从Java小程序确定主机?

[英]How do I determine the host from my Java applet?

I have developed an applet that needs to read in a data file from the user. 我已经开发了一个小程序,需要从用户读取数据文件。 I have the user pick the file outside the applet and upload it, I then move a copy of the file to the applet folder so I can access it with the applet with only sandbox security. 我让用户在applet外部选择文件并将其上传,然后将文件的副本移动到applet文件夹,以便仅使用沙箱安全性就可以使用applet访问它。 My problem arises from the fact that I run the applet on several hosts. 我的问题来自于我在多个主机上运行小程序的事实。 How can I determine the correct host this applet was downloaded from so I can connect to the proper host for the correct data file? 如何确定从该applet下载的正确主机,以便可以连接到正确主机以获得正确数据文件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM