Run windows form app from asp.net page

ⅰ亾dé卋堺 提交于 2019-12-13 21:39:16

问题


I want to run a Windows form app from ASP.net page when clicked on a ASP button. Now I don't want to show the app on ASP.net page, as I said earlier, I want to start it.

I'm calling the Windows form app directly behind a button but it is not working and giving errors. when I searched for it, I saw that we cannot call/run windows form app from ASP.net page. So any one who can give a better idea to achieve this task?

How about Client/server technique? So that when I pass a message from client (ASP.net page) to server (Win Form App), the app should run.

Please help!


回答1:


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



来源:https://stackoverflow.com/questions/16245273/run-windows-form-app-from-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!