【问题标题】:Start exe application from website从网站启动 exe 应用程序
【发布时间】:2014-08-02 10:42:25
【问题描述】:



我在ASP.NET 中有一个webpage
我有一个使用C# 创建的.exe 应用程序。
首先,用户必须下载.exe 应用程序并将其复制到C:\
我可以在网页上给出说明。
在网页中使用link,我需要打开那个特定的.exe 应用程序。
我尝试了以下 代码:

using System.Diagnostics;
......
......
......
ProcessStartInfo info = new ProcessStartInfo(@"C:\app.exe");
Process.Start(info);

这在本地运行良好,但是当我将其上传到webserver 时,我得到了以下Exception

Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified

然后我在Google 中搜索,发现iTunes 是如何从网站启动的。
喜欢以下链接。

Launches iTunes.exe from here

然后我尝试使用以下link打开iTunes。

<a href="itunes:///">Open iTunes</a>

它运行良好,但我对我的.exe 应用程序进行了同样的尝试,它没有打开,同时显示以下错误

HTTP Error 400 - Bad Request.

任何人都可以指导我从我的webpage 打开我的.exe 应用程序。
如果.exeserverBin 文件夹中,那我该怎么办。
谢谢

【问题讨论】:

  • 检查服务器上exe文件的路径
  • @L-Three:我读过这个。我也试过。只有从这个链接我才知道 iTunes。
  • @PeterJ app.exe 在本地系统中。

标签: asp.net exe


【解决方案1】:

这个

ProcessStartInfo info = new ProcessStartInfo(@"C:\app.exe");
Process.Start(info);

在服务器而不是客户端计算机上启动新服务。您收到一条错误消息,因为您的服务器上没有“C:\app.exe”。

您无法从 asp.net 服务器应用程序启动本地计算机上的应用程序。

iTunes 正在使用“协议处理程序”,请阅读 How does the Apple iTunes web site launch the iTunes application on my computer when I click the blue "Launch iTunes" button?

【讨论】:

  • 这应该是一条评论。
  • @smirnov:我怎样才能做到这一点?
  • 您无法从 asp.net 服务器应用程序在本地计算机上启动应用程序。
猜你喜欢
  • 1970-01-01
  • 2010-09-19
  • 2010-10-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-13
  • 2013-09-17
  • 1970-01-01
相关资源
最近更新 更多