我怎样才能得到一个客户机上的程序从一个ASP.NET页面中运行? [英] How can I get a program on a client machine to run from an ASP.NET page?

查看:149
本文介绍了我怎样才能得到一个客户机上的程序从一个ASP.NET页面中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我试图在Intranet上运行的应用程序。在我的机器,它的工作很大(鬼才),但是当我把它给服务器,它没有工作。当我看到系统找不到指定文件的错误,我想通它必须是一些与试图运行一个程序,它是一个客户机上。

I have an app that I'm trying to run on an intranet. On my machine it worked great (famous last words) but when I put it up to the server, it didn't work. As soon as I saw the "the system cannot find the specified file" error, I figured it had to be something with trying to run a program that's on a client machine.

是的,这将是一个安全的噩梦,如果在浏览器中的任何应用程序可以运行在客户端计算机上的可执行文件。这是对企业内部网有什么不同?它会在所有运行几台电脑有IE浏览器和.NET的同一版本,它可以运行在,他们都拥有所需的.exe文件运行。

Yes, it would be a security nightmare if any app in a browser could run an executable on a client machine. Is this any different for intranet? The few computers it would run on all have the same version of IE and .NET that it will run on, and they all have the required .exe to run.

下面是该项目的概述:


  • 雇员和参与者走进包含电脑的房间。

  • 的员工打开我的web应用程序并查找这个人的ID(这部分作品)

  • 点击记录应该执行一个隐藏的推出已安装程序,它开始记录的。

  • 完成后,员工单击完成(或应用程序超时),并保存该文件。

  • 文件被上传到服务器。

  • 的员工缺乏技术经验,所以我的目标是pretty多有一个网站,让他们去那里是超过一箱多一点得到了参与者的ID和两个巨大的记录和STOP按钮

谁能帮我对如何做到这一点(或至少让我知道这是不可行的)?

Can anyone help me out on how to do this (or at least let me know it's not feasible)?

推荐答案

如果你把你的网站在IE可信或Intranet区域,下面的JavaScript会工作得很好。我用这一个内部给我们的电脑支持DB搜索链接到我们的远程屏幕控制软件:

If you put your site in the IE Trusted or Intranet zone, the following Javascript will work just fine. I use this one internally to link our PC support DB search to our remote screen control software:

<script type="text/javascript" language="javascript">
    function runDameWare(strHostname, blControl) {
        var objShell = new ActiveXObject("Wscript.Shell");
        var strCommand = "C:\\Program Files\\Dameware\\dwrcc.exe -c: -h: -m:";
        strCommand += strHostname;
        if (blControl) {
            strCommand += " -v:";
        }
        objShell.Exec(strCommand);
    }
</script>

我的理解是,上传你的工作成果在本地程序到Web服务器可以使用的HttpWebRequest 类,实现如本​​文所示:

My understanding is that uploading the results of your work in the local program to the web server can be accomplished using the HttpWebRequest class, as shown in this article:

http://forums.asp.net/p/1482778/3464854.aspx

编辑:
这是我所说的上述功能。基本上,我只是渲染一个普通的&LT; A&gt;在该的onclick 属性元素。有可能是一个更清洁的方式做到这一点,但它的作品:

This is how I call the above function. Basically I'm just rendering a plain <a> element with the onclick attribute. There's probably a cleaner way to do it, but it works:

标记:

<asp:TemplateField>
    <ItemTemplate>
        <%# RenderDameWareLinks(Eval("ResourceName"))%>
    </ItemTemplate>
</asp:TemplateField>

code:

Protected Function RenderDameWareLinks(ByVal strHostname As String) As String
    Dim strFullLink As String = String.Empty
    Dim strViewLink As String = String.Empty
    strFullLink = "<a onclick=""runDameWare('" & strHostname & "', false);"">"
    strFullLink &= "<img alt=""Connect using DameWare"" src=""Image/dameware1.gif"" style=""padding: 2px;"" />"
    strFullLink &= "</a><br/>"
    strViewLink = "<a onclick=""runDameWare('" & strHostname & "', true);"">"
    strViewLink &= "<img alt=""Connect (View Only) using DameWare"" src=""Image/dameware2.gif"" style=""padding: 2px;"" />"
    strViewLink &= "</a>"
    Return strFullLink & strViewLink
End Function

这篇关于我怎样才能得到一个客户机上的程序从一个ASP.NET页面中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆