是否有与可编写脚本的 Java applet 等效的 .Net 技术? (针对特定用例)

发布于 2024-10-09 01:59:31 字数 466 浏览 0 评论 0原文

我公司的核心技术组件之一是用于数字签名的 Java Applet。这是一个无头组件,从某种意义上说,所有表示都是通过 HTML/CSS 处理的,并且 applet 方法是从 Javascript 调用的。小程序本身在页面中不可见。

现在我们遇到了这样一种情况:我们有一些特定的签名格式(嵌入在 docx [OfficeOpenXML] 文档中的签名),使用 .Net 类更容易处理,并且我们有一些作为 .Net DLL 的原型实现。

在旧的 COM 年代,Active/X 组件用于具有类似目的的网页,并且也可以编写脚本。我想知道现在嵌入 .Net 类并使用 Javascript 编写脚本的等效项(如果有)是什么。

使用什么技术? Silverlight 是一种方法,还是偏向 RIA(即具有视觉外观的应用程序)?如果这是一个好的解决方案,我将非常感谢指向该方向的教程或代码示例的指针。我过去接触过 .Net (C#) 大约一年,但没有接触过 Silverlight。

One of the core technology components at my company is a Java Applet for digital signature. This is a headless component, in the sense that all presentation is handled via HTML/CSS, and the applet methods are invoked from Javascript. The applet itself is not visible in the page.

Now we've come to a situation where we have some specific signature format (signature embedded in docx [OfficeOpenXML] documents) that is more easily handled using .Net classes, and we have some prototype implementation as a .Net DLL.

In the olden COM years, Active/X components were used in web pages with a similar purpose, and were scriptable too. I would like to know what (if any) is the equivalent now for embedding .Net classes and scripting them using Javascript.

What is the technology to use? Would Silverlight be the approach, or is it biased towards RIA, i.e. apps with a visual appearance? If it is a good solution, I will greatly appreciate pointers to tutorials or code samples in that direction. I've had roughly 1 year exposure to .Net (C#) in the past but none to Silverlight.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫轩蝶泪 2024-10-16 01:59:31

是的,Silverlight 是相当于 Java applet 的 .Net。您可以使用 C#、VB、Python、Ruby 等编写代码,并且可以通过 DOM 和 Javascript 与其进行交互。

不过,在您的评论之一中,您表示您希望使用存储在本地计算机上的客户端证书来签署文档。我不知道有什么方法可以使用基于浏览器的 Silverlight 应用程序来做到这一点。您可以使用浏览器外的 Silverlight 应用程序加载 COM 对象来为您执行命令,但随后您将无法编写脚本。

Yes, Silverlight is .Net equivalent to Java applets. You write your code in C#, VB, Python, Ruby, etc. and you can interact with it via the DOM and Javascript.

In one of your comments, though, you indicate that you want to sign documents with client certificates stored on the local machine. I don't know of any way to do that with a browser-based Silverlight app. You can use an out-of-browser Silverlight app to load a COM object to do your bidding for you, but then you wouldn't be able to script it.

蓝天 2024-10-16 01:59:31

Silverlight 不是此处使用的技术。它不向您提供所需的用户系统访问权限。

然而,没有什么可以阻止您使用 .NET 代码创建 ActiveX/COM 组件。然后,您可以围绕完成工作所需的完整 .NET 类创建 COM/Scriptable 友好的包装器。

当然,这不再是跨浏览器的。如果您需要跨浏览器解决方案,那么您将陷入痛苦的世界,因为您需要将其他浏览器的扩展技术连接到某些 .NET 代码。这很可能涉及一些 COM。

Silverlight is not the technology to use here. It doesn't offer you the access to the user's system that you require.

However there is nothing stopping you from creating an ActiveX/COM component using .NET code. You can then create COM/Scriptable friendly wrapper around the the full .NET classes you need to do your work.

Of course this ceases to be cross-browser. If you need a cross-browser solution then you are into a world of pain since you will need to interface from extension tech for other browsers into some .NET code. This may well involve some COM along way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文