简体   繁体   English

将Windows Forms .NET应用程序的UI移至Web

[英]Move UI of Windows Forms .NET application to web

I have written a windows forms (.NET C#) application that encodes video and is essentially a GUI for ffmpeg. 我已经编写了一个Windows窗体(.NET C#)应用程序,该应用程序对视频进行编码,本质上是ffmpeg的GUI。 The requirement has changed, and we now want to move the UI to a web page and have the encoding done as a windows service. 要求已更改,现在我们希望将UI移至网页,并以Windows服务的形式进行编码。

The following requirements also apply: 以下要求也适用:

  • Two-way communication between browser's web page and service (ie start encoding using web interface and have service notify progress back to web page) 浏览器的网页和服务之间的双向通信(即,使用Web界面开始编码并让服务将进度通知回网页)
  • Service should be ported to Mac OS X too 服务也应该移植到Mac OS X
  • UI should be a standard webpage (should consist of HTML/CSS/JavaScript/Flash etc...) 用户界面应为标准网页(应由HTML / CSS / JavaScript / Flash等组成)

I was thinking of WCF for the windows service, but I have zero WCF experience. 我当时正在考虑将WCF用于Windows服务,但是我的WCF经验为零。 Will WCF provide a good basis for 2 way communication between the web page and the service? WCF是否将为网页和服务之间的双向通信提供良好的基础?

Also, I need to think about porting the service to Mac OS X, and I noticed that WCF is only partially implemented in Mono (see http://www.mono-project.com/WCF_Development ). 另外,我需要考虑将服务移植到Mac OS X,我注意到WCF仅在Mono中部分实现(请参阅http://www.mono-project.com/WCF_Development )。 Will this be an issue? 这会是个问题吗? Does anyone have any experience with WCF development in Mono? 有没有人在Mono中的WCF开发方面有任何经验?

What would be the best route to meeting the requirements above? 满足以上要求的最佳途径是什么? I would love to hear any suggestions... 我很想听听任何建议...

EDIT I should clarify - this is not a web application, it will run entirely on client side. 编辑我应该澄清-这不是一个Web应用程序,它将完全在客户端运行。

Service should run client side and interact with a webpage inside a browser (which is also client side). 服务应在客户端运行,并与浏览器(也是客户端)内的网页进行交互。

If you want a UI in HTML – which is what a "UI to a web page" would mean to most – then WCF is the wrong approach. 如果您想要HTML中的UI(这是“ Web页面的UI”对大多数用户的意义),那么WCF是错误的方法。 WCF is for creating highly interoperable (WS-* standards) clients and/or servers; WCF用于创建高度可互操作的(WS- *标准)客户端和/或服务器; not for web pages. 不是网页。

Better looking at ASP.NET MVC. 最好看一下ASP.NET MVC。 This is a very different model to WinForms, 1 but allows easy moving from from rendering a UI into HTML to generating XML or JSON for a Web API (behind AJAX from a Web UI or a native client). 这是与WinForms完全不同的模型, 1但可以轻松地从将UI呈现为HTML转换为为Web API生成XML或JSON(在Web UI或本机客户端的AJAX之后)。

As I understand it ASP.NET MVC is substantially supported on Mono; 据我了解,Mono基本上支持ASP.NET MVC。 and this should become easier with much of ASP.NET being open source now. 而且随着现在许多ASP.NET成为开源,这应该变得更加容易。

See also this answer from yesterday. 另请参阅昨天的答案


1 WinForms would be less of a move, but it would then be harder to do the API side without another technology shift (albeit ASP.NET WebForms and MVC can be easily mixed in one Web App). 1 WinForms不太会走,但是如果不进行另一项技术转换,则在API方面将变得更加困难(尽管ASP.NET WebForms和MVC可以轻松地集成在一个Web App中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM