开发者

Is there a .Net technology equivalent to scriptable Java applets? (for a specific use-case)

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 pag开发者_如何学编程es 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜