<script language=javascript>
var wsh=new ActiveXObject("wscript.shell");
wsh.run("D:\\abc.exe");
</script>这个做成网页,直接运行是正确的,但架设在IIS中却报错。报错:找不到文件"D:\\abc.exe"或其他的组件之一。那个高人解答下,是什么原因?
var wsh=new ActiveXObject("wscript.shell");
wsh.run("D:\\abc.exe");
</script>这个做成网页,直接运行是正确的,但架设在IIS中却报错。报错:找不到文件"D:\\abc.exe"或其他的组件之一。那个高人解答下,是什么原因?
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("D:\\abc.exe");
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
System.Diagnostics.Process.Start(startInfo);
Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\papreg]
@="URL:papreg Protocol"
"URL Protocol"=""[HKEY_CLASSES_ROOT\papreg\shell][HKEY_CLASSES_ROOT\papreg\shell\open][HKEY_CLASSES_ROOT\papreg\shell\open\command]
@="\"E:\\Example\\OAexe\\abc.exe\" \"%0\""
能后执行papreg://就可以调用本地的abc.exe文件这个方法有个缺点,就是,路径(@="\"E:\\Example\\OAexe\\abc.exe\" \"%0\""
)是事先写好的,没有做活,大家能不能帮我想个办法,把其路径写活来。还有一种就是利用ocx控件,具体怎么用,现在还在摸索中。有那个大侠知道的么?
,System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("D:\\abc.exe");
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
System.Diagnostics.Process.Start(startInfo);
放进去了,abc.exe现在是和网页程序放在同一个目录下
<script language="javascript" type="text/javascript">
var oShell = new ActiveXObject("WScript.Shell");
var prog = "C:\\Program Files\\Microsoft Office\\OFFICE12\\winword.exe";
oShell.run ('"'+prog+'"',1);
</script>将网页通过IIS web服务器以http协议调用后,则出现Automation服务器不能创建对象的错误,无法运行。有人提到用一个叫LaunchInIE的ActiveX控件,看了一下说明,说在客户端安装这个控件并设置注册表后可以通过这个ActiveX控件来运行客户端程序,这是控件的简介:
A web page can't readily start an application on the client's computer: quite a few webmasters run into this problem.This article presents the free LaunchinIE ActiveX Control that will enable HTML pages to start whatever application on the client's machine, without security warnings.
To ensure security, LaunchinIE needs to be carefully configured client-side; due to this restriction it's only fit for intranet use.At last, web pages can start Word, Excel, or any other corporate application without complaints. Securely.
是否确实如此我没有试,楼主感兴趣的话自己看看,ActiveX控件是免费的,说明及下载地址在这里:
http://www.whirlywiryweb.com/q/launchinie.asp