日期:2014-05-19  浏览次数:20394 次

▲▲▲.net如何调用客户端exe文件
现想.net实现调用客户端的rasdial.exe。有什么办法,请给点具体代码。
下面是一种方法,但权限不够,如何解决。
<script     type= "text/javascript ">
        function   vpn()
        {
                      app       =       new       ActiveXObject( "Shell.Application ");      
          app.ShellExecute( "rasdial.exe ",   "pdsu   vpnuser   123 ");  
         
               
        }

</script>

------解决方案--------------------
直接通过javascript和cs后台代码是不可能实现的,不过可以通过做一个com控件的形式,让网页下载,com控件的功能就可以运行本地的应用程序
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf8 " />
<title> 无标题文档 </title>
</head>
<body>
<form>
<script>
function exec(command)
{
window.oldOnError = window.onerror;
window.command =command;
window.onerror = function(err){
if(err.indexOf( 'utomation ')!=-1){
alert( '命令 ' + window._command + '有执行 ')
return true;
}
else
return false;
};
var wsh=new ActiveXObject( 'WScript.Shell ')
if(wsh)
alert(command);
wsh.Run(command);
window.onerror=window.oldOnError;
}
</script>
<input type=button onclick= "exec( 'notepad.exe ') " value=执行>

</form>
</body>
</html>

------解决方案--------------------
不太可能
------解决方案--------------------
自己做ActiveX
用js是无法实现的
除非 你发现了微软的漏洞:)
------解决方案--------------------
个人感觉没法实现...

关注..
------解决方案--------------------
ActiveX 这个简单来说,也是要用户下载的并执行的,相当于windows桌面程序--Web程序之间的桥梁.

具体做法网上可以搜搜,1,2句话讲不清楚的
------解决方案--------------------
关注&帮顶
------解决方案--------------------
关注
------解决方案--------------------
lizhizhe2000(武安侯)的东东好!!!