如何让ASP运行一个WINDOWS程序??

来源:百度知道 编辑:UC知道 时间:2024/05/24 17:59:28
假设这个WINDOWS程序是 C.exe

怎样在ASP页面中通过button运行这个C程序。

代码多少??

如果有好答案,再加50分!

1.导入命名空间 using System.Diagnostics;
2.在Butten点击事件里写 Process.Start(@"c.exe");这里要填绝对路径和相对路径

不知道你要在客户端还是在服务端执行。
客户端
============
<script language="vbscript">
sub exec
Set WShShell = CreateObject("WScript.Shell")
runcmd="notepad.exe" //这里是路径
RetCode = WShShell.Run(runcmd,1,True)
end sub
</script>
<a href="#" onclick="exec()">open</a>
================
上面的代码会在客户端打开一个记事本

服务器端
================
<%
sub exec
Set WShShell = Server.CreateObject("WScript.Shell")
runcmd="ping www.xxiyy.com"
RetCode = WShShell.Run(runcmd,1,True)
end sub
exec()
%>
=================
上面的代码会让服务器端ping地址www.xxiyy.c