Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

c# - Run windows form app from asp.net page

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...