0

单击 ASP 按钮时,我想从 ASP.net 页面运行 Windows 窗体应用程序。现在我不想在 ASP.net 页面上显示应用程序,正如我之前所说,我想启动它。

我直接在按钮后面调用 Windows 窗体应用程序,但它不工作并给出错误。当我搜索它时,我看到我们无法从 ASP.net 页面调用/运行 Windows 窗体应用程序。那么有谁能给出更好的主意来完成这项任务吗?

客户端/服务器技术怎么样?因此,当我将消息从客户端(ASP.net 页面)传递到服务器(Win Form App)时,该应用程序应该运行。

请帮忙!

4

1 回答 1

4

If you want to launch the WinForms app from a web page, the best approach is probably to use ClickOnce technology. It allows you to publish your application directly through a web page (no separate installer needed).

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology if you have developed your projects with Visual Basic and Visual C#.

http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.110).aspx

ClickOnce also works with C++ apps, but there are some additional steps

http://msdn.microsoft.com/en-us/library/ms235287.aspx

There's an excellent answer on Stack Overflow that reviews some things to be aware of. Suggest you read through that as well

https://stackoverflow.com/a/2365481/141172

If you want to launch your application (possibly including parameters) from a web page, one approach is to have the application register a protocol handler. A protocol handler allows an application to react to a URL with a new protocol that you define, e.g. myappname://TheFileToOpen

http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

于 2013-04-26T21:13:40.210 回答