使用applet加载.DLL并在客户端上使用它 [英] Load .DLL with applet and use it on client
问题描述
我可以在小程序中将 .dll
从服务器加载到客户端,然后在客户端调用加载.dll(使用JNI)的方法?
Can I load .dll
from server to client within applet, and then call methods of loaded .dll (using JNI) on client side?
推荐答案
当然可以。小程序需要由开发人员进行数字签名,并由最终用户信任(他们在出现提示时点击确定)。将本机放在Jar的根目录下,并使用存档
属性中的引用将其添加到小程序的运行时类路径中。
Certainly. The applet will need to be digitally signed by the developer, and trusted by the end user (they click 'OK' when prompted). Put the natives in the root of a Jar and add it to the run-time class-path of the applet, using a reference in the archive
attribute.
使用存档属性将传统的本地方式部署到小程序的缺点是每个客户端都可以适用于Windows,OS X和* nix的本机。最近(Sun插件1.6.0_10中介绍的Java Plug-In 2)的功能是使用
Using the traditional method of deploying natives to an applet using the archive
attribute has the disadvantage that every client gets the natives for Windows, OS X and *nix. 3 times as many natives as they actually need.
a href =https://stackoverflow.com/tags/java-web-start/info> Java Web Start ,然后允许我们为用户分配本机的下载。每个操作系统只能得到需要的本地人。
A recent (Java Plug-In 2, introduced in Sun's version 1.6.0_10) ability is to launch embedded applets using Java Web Start, which then allows us to partition the download of natives for the user. Each OS will get only the natives it needs.
..如何声明applet类-路径?
..how to declare applet class-path?
它在 资源
部分。
EG来自docs。
<resources os="SunOS" arch="sparc">
<nativelib href="lib/solaris/corelibs.jar"/>
</resources>
任何没有$ code> os的资源部分或 arch
属性将由所有JWS客户端下载,其余仅由匹配的。
Any resources section with no os
or arch
attribute will be downloaded by all JWS clients, the rest only by those that match.
这篇关于使用applet加载.DLL并在客户端上使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!