如何添加Web界面来远程监视和控制现有的Windows窗体应用程序? [英] how to add an web interface to remotely monitor and control an existing windows forms application?

查看:115
本文介绍了如何添加Web界面来远程监视和控制现有的Windows窗体应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用c#编写的windows表单应用程序在本地pc运行,我希望我可以添加一个web界面,这样我就可以使用Web浏览器远程监控它,基本相同或类似的界面和功能,例如 http://lifehacker.com/260393/remote-control-your- torrents-with-utorrents-webui ,我想知道如何轻松实现这一点,我有完整的Windows窗体应用程序代码,这是开源的,但由于我不是作者,所以从头开始重写毫无疑问。

I have an windows forms application written in c# running at local pc, I wish that I can add an web interface to it so I can use web browser to remotely monitor and control it, basically same or similar interface and functions, an example of this is http://lifehacker.com/260393/remote-control-your-torrents-with-utorrents-webui, I want to know how to achieve this easily, I have the full code of the windows form application, which is open source, but since I am not the author, rewriting it from scratch is out of question.

推荐答案

简短的回答是它取决于。它取决于应用程序的编写方式,是否使用MVC框架或其他方式在UI层和后端之间粘贴。从它的开源,我敢打赌,它不是MVC或至少不容易解耦,并且可能无法在不重写大部分应用程序的情况下添加Web界面。



你从哪里开始?查找如何将Web服务器嵌入到应用程序中,为请求提供服务以及显示网页。 CodeProject上有很多关于类似内容的文章,甚至是你可以使用的网络服务器库。
The short answer is "it depends". It depends on how the application was written, if it uses an MVC framework or some other way to stick something between the UI layer and the back-end. Since its open source, I would bet that its not MVC or at least not easily decoupled and it may be impossible to add a web interface without rewriting much of the application.

Where do you start? Look up how to embed a web server into the application, service the requests, and present web pages. There are numerous articles on CodeProject about similar stuff, even a web server library you could use.


这篇关于如何添加Web界面来远程监视和控制现有的Windows窗体应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆