是否可以使用小程序获取正在运行的进程列表? [英] Is it possible to get a list of running processes using an applet?

查看:28
本文介绍了是否可以使用小程序获取正在运行的进程列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用在浏览器中运行的 Java 小程序获取正在运行的进程列表.我的理解是,只要小程序被签名,就可以得到这些信息.这是准确的吗?对于未签名的小程序,这可能吗?最后,是否有任何可用的 FOS 小程序可供我查看?

I'd like to get the list of running processes using a java applet running in a browser. My understanding is that, as long as the applet is signed, it will be able to get this information. Is this accurate? Is this possible with an unsigned applet? Finally, are there any FOS applets available that I could take a look at?

谢谢.

推荐答案

一个小程序需要在它想要访问/执行本地系统资源时进行签名.这包括执行 Runtime#exec()ProcessBuilder 需要能够获取正在运行的进程列表.

An applet needs to be signed whenever it want to access/execute local system resources. This includes executing Runtime#exec() or ProcessBuilder which is required to be able to get a list of running processes.

您可以在此处找到如何获取该列表的基本示例视窗.我建议在继续之前检查 if (System.getProperty("os.name").startsWith("win")).

You can find here a basic example how to get that list in Windows. I'd suggest to check if (System.getProperty("os.name").startsWith("win")) before continuing with that.

将给定的示例移植到小程序中并不难,只要让类扩展 JApplet 并从 AccessController#doPrivileged().

Porting the given example into an applet isn't that hard, just let the class extend JApplet and execute the whole code from inside AccessController#doPrivileged().

对于小程序的签名,您可以手动签名,最终用户只会面临安全警告并确认是否执行它,或者您可以让第三方公司签署一些$$$,例如VeriSign,这样最终用户不会面临安全警告.不签名会导致小程序根本无法运行.

As to signing the applet, you can either sign it manually, the enduser would only face a security warning with a confirmation whether to execute it or not, or you can let it sign by a 3rd party company for some $$$, e.g. VeriSign, this way the enduser won't face the security warning. Not signing it will cause the applet not be able to run at all.

这篇关于是否可以使用小程序获取正在运行的进程列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆