[英]Windows Form Application Inside An ASP.NET Page?
I have a game I made in windows form and an asp.net website(with a masterpage) 我有一个用Windows窗体制作的游戏和一个asp.net网站(带有母版页)
I made a new page in the website called game.aspx and I want that users could play the game inside the website (inside a frame, not another window) 我在网站上创建了一个名为game.aspx的新页面,我希望用户可以在网站内(在框架内,而不是在另一个窗口内)玩游戏。
It is possible to host a WinForms user control in a web page, but it is only supported in Internet Explorer, and even there the support is poor. 可以在网页中托管WinForms用户控件,但仅Internet Explorer支持该控件,甚至那里的支持也很差。
I would rather suggest that you package the game as a ClickOnce application that you deploy from your web site. 我宁愿建议您将游戏打包为从网站部署的ClickOnce应用程序。
Edit: 编辑:
If you REALLY want to do it you will find many examples on the web. 如果您真的想这样做,您会在网上找到许多示例。 Try this google search: http://www.google.com/search?q=user+control+host+winforms+web+page+html
尝试以下Google搜索: http : //www.google.com/search? q=user+control+host+winforms+web+page+ html
This article from codebetter.com looks interesting for example: http://codebetter.com/petervanooijen/2007/06/18/including-a-winforms-user-control-in-an-asp-net-web-page/ 例如,来自codebetter.com的这篇文章看起来很有趣: http ://codebetter.com/petervanooijen/2007/06/18/includes-a-winforms-user-control-in-an-asp-net-web-page/
If the game is HTML/JavaScript based then you're all set. 如果游戏是基于HTML / JavaScript的,那么您已经准备就绪。 But if the game is written in WinForms there is no way to host it from within a webpage without it being installed on the client's machine and using some kind of container (like ActiveX) and some fancy footwork.
但是,如果游戏是用WinForms编写的,则没有将它安装在客户端计算机上并使用某种容器(例如ActiveX)和一些花哨的方法就无法从网页中托管它的方法。
You probably want to look at Silverlight or Flash or even HTML5. 您可能想看一下Silverlight或Flash甚至HTML5。 Implement your game in one of those and it can be played inside the client's browser.
用其中一种实现您的游戏,并且可以在客户端的浏览器中进行游戏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.