angular - Angular6 中用于 calc.exe 的 ActiveXObject
问题描述
我从 html 中添加了这段代码:
<script type="text/javascript">
var fso = new ActiveXObject("Scripting.FileSystemObject");
function execProg(progam){
var prog = new ActiveXObject("WScript.Shell");
prog.run(progam, 0, true);
}
</script>
然后在我的 component.ts 中单击 html ->
public comprobarUrl = function() {
this.execProg('Calc');
}
如果我在 html 中这样做是正确的,我可以用 IE 打开 calc.exe,但如果我在 Angular6 中这样做,我会得到
The object does not accept the property or the 'execProg' method