在JavaScript中使用wshShell和ActiveXObject

时间:2014-02-11 03:30:31

标签: c# javascript asp.net activexobject

我看到了很多帖子,但我发现自己很困惑。我知道没有关于ActiveX但是设法让下面的工作,但只有在手动更改IE中的安全设置时。使用给定的代码,实现的最佳方法是什么?是否有可用的脚本可以更改所有用户的IE设置?这严格用于公司内部网。

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Image Viewer</title>

<HTA:APPLICATION ID="oMyApp" 
 APPLICATIONNAME="Application Executer" 
 BORDER="no"
 CAPTION="no"
 SHOWINTASKBAR="yes"
 SINGLEINSTANCE="yes"
 SYSMENU="yes"
 SCROLL="no"
 WINDOWSTATE="normal">

<script type="text/javascript" language="javascript">
function RunFile() 
{
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("C:/PATH/ViewImageForm.exe", 1, false);
}
</script>
</head>

<body onload="RunFile();">

HTML Design code:
<form id="form1" runat="server">    
<div>
    <asp:TextBox ID="TextBox1" runat="server" Visible="false"></asp:TextBox>
</div>
</form>

0 个答案:

没有答案