在 Web 浏览器中运行 WinForms 应用程序

在 Web 浏览器中运行 WinForms 应用程序

问题描述:

我有一个 win 表单应用程序,我试图在网络浏览器中运行它,我翻遍了网络并找到了一些链接:

I have a win form application and i'm trying to run it inside the web browser,i rummaged through web and found some links:

我试过这个链接:嵌入使用 WPF 的 Internet 浏览器中的 .NET WinForms 应用程序,这工作正常,但问题是最终用户必须安装 dot net frame work 才能运行应用程序.

I tried this link:Embedding a .NET WinForms Application in an Internet Browser Using WPF ,this works fine but the problem is that the end-user has to install dot net frame work for running the application.

我在这里找到了另一个链接 在 Web 浏览器中运行 WinForms 应用程序,使用 Visual WebGui 开发框架.

I found another link here for running a WinForms Application Inside Web Browser,with Visual WebGui development framework.

有人使用过 WebGui 吗?

Has anyone had any experience with WebGui?

winforms 不是网络.网络就是网络.

winforms is not web. Web is Web.

Web 意味着 HTML + 某些东西(通常是 JavaScript、CSS 和 jQuery 之类的).

Web means HTML + something (usually JavaScript, CSS and probably jQuery or such).

1 - 如果您需要一个 Web 应用程序,并希望使用 .Net 来实现,请创建一个 ASP.Net 应用程序.

1 - If you need a web application, and want to do it with .Net, create an ASP.Net Application.

2 - 如果您需要 Windows 应用程序(桌面),请创建一个 WPF 应用程序.

2 - If you need a Windows application (Desktop), create a WPF application.

3 - 如果您需要 Windows 8Metro"风格的应用程序(又名 Windows Store 应用程序),请创建一个 WinRT XAML 应用程序.

3 - If you need a Windows 8 "Metro" style application (a.k.a Windows Store App), create a WinRT XAML application.

4 - winforms 完全没用.忘记那个.

4 - winforms is completely useless. Forget that.

如果您的客户不想安装任何版本的 .Net Framework,您唯一的选择是 #1.

If your customers don't want to install any version of the .Net Framework, your only option is #1.

Winforms 应用程序永远不会是 Web 应用程序,无论您进行任何黑客攻击以使其在 Web 浏览器中运行.

A winforms application will NEVER be a web application, regardless of any hacks you do to make it run inside a web browser.

XBAP(WPF 浏览器应用程序)也不是 Web 应用程序.它只是一个普通的 WPF 客户端应用程序,没有自己的窗口.

an XBAP (WPF Browser Application) is also NOT a web application. It's just a regular WPF client application that does not have it's own window.

如果你以正确的方式做事(也就是说,保持关注点分离并将应用程序逻辑放在控制器或视图模型中,而不是大多数winforms开发人员通常习惯的可怕的实践背后的代码),它在保持数据访问和业务逻辑层完好无损的同时,重用您的应用程序逻辑并创建新应用程序(网络或其他方式)应该不难.

If you did things the right way (that is, maintaing separation of concerns and putting application logic in Controllers or ViewModels instead of the horrible code behind practices most winforms developers are generally used to), It should not be that hard to reuse your application logic and create a new application (web or otherwise) while maintaining the Data Access and Business Logic layers intact.