Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...