【发布时间】:2011-12-23 22:37:57
【问题描述】:
tldr;如何将 JScript.NET dll 标记为安全的脚本?
考虑一下这个 JScript.NET 库(helloworld1.js):
package helloworld1{
class test1 {
public function test1run(){
return 'This is a string returned from helloworld1.dll';
}
}
}
运行后
jsc.exe /nologo /t:library helloworld1.js
和
regasm /nologo /codebase helloworld1.dll
我可以在我的本地 html 页面上使用它:
var helloworld1 = new ActiveXObject("helloworld1.test1");
alert(helloworld1.test1run());
一切正常,我收到This is a string returned from helloworld1.dll 的提醒。
现在...我想摆脱每次实例化 ActiveX 对象时弹出的可怕 IE 安全警告:
An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?
我知道删除安全警告的方法是将dll标记为safe for scripting并实现IObjectSafety。
我知道如何在 VB6 和 VB.NET 中执行此操作,但如何在 JScript.NET 中实现它?
非常感谢任何帮助。
【问题讨论】:
-
@Erik Philips:我不这么认为。据我所知,这个问题是关于使用真实证书签署 dll,我的问题涉及在 JScript.NET 中实现
IObjectSafety。 -
你说
I want to get rid of the dreaded IE security warning which pops up every time the ActiveX object is instantiated,这需要对你的DLL进行签名,这也需要实现IObjectSafety。 -
@Erik Philips:我在问题标题中添加了
programmatically。希望能让你满意。
标签: .net jscript jscript.net