Can I convert from C# to asp.Net to host applicati

2019-05-28 01:10发布

问题:

Is it possible to convert a C# application into an asp.Net webpage? All i want to do is display the application in a website of mine!? The website is made in flash and if i choose to open the application directly it downloads the .exe which is not what i pretend.

Edit: Application has only about 30 buttons and has one additional form besides first one.

回答1:

All of your standard C# classes/libraries should migrate over smoothly. What you're going to have a tough time with is converting the (presumably) winforms user interface into a fully-functional web interface. There is no direct conversion, but most winforms controls have an approximate web equivalent.



回答2:

Sounds like a good potential candidate for the CodeDOM. This article should point you in the right direction; it demonstrates how to convert a windows form to a web form, and appears to do it quite successfully from the screenshots.

At the end of the day, it may be easier to just handle it manually. Unless this is a very simple application, you'll probably have to bite the bullet and DIY.



回答3:

I think the easiest answer to this question is, no. Desktop app and web apps have completely different structure even though you can use C# in the code behind. There's no simple way to convert a desktop app project to an ASP.net project that I know of.