简体   繁体   English

可以广播到浏览器的桌面应用程序

[英]Desktop application that can broadcast to browser

I started learning C# just under a month ago and I've gotten pretty familiar (I think) with wpf, xaml and the MVVM pattern. 我不到一个月前就开始学习C#,我对wpf,xaml和MVVM模式非常熟悉(我认为)。 I'm trying to make a program for managing sporting events (powerlifting and weightlifting being the focus of the first version). 我正在尝试制作一个用于管理体育赛事的程序(举重和举重是第一版的重点)。

We already have a program for this but it is not at all user friendly and requires some training and knowledge of networking to use. 我们已经有一个用于此的程序,但是它根本不是用户友好的,并且需要一些培训和网络知识才能使用。 The current program has a client and a server application where the server is for entering information while the client displays it. 当前程序具有一个客户端和一个服务器应用程序,其中服务器用于在客户端显示信息时输入信息。 The server offers several views for things like who's up next on the platform, who's winning etc. Each view is displayed on a monitor and each monitor needs to be connected to a computer that has the client installed. 服务器提供了一些视图,用于显示平台上接下来的人,谁获胜等。每个视图都显示在监视器上,每个监视器都需要连接到已安装客户端的计算机上。 The client computer can only show one view at a time, ie only one monitor per computer. 客户端计算机一次只能显示一个视图,即每台计算机只能显示一个监视器。 Each client then needs to be configured so that it knows the server's ip address etc. 然后需要配置每个客户端,以便它知道服务器的IP地址等。

What I'm trying to do is make a simpler solution where there is only the server application which then broadcasts (I'm not sure on the terminology, like I said, I've only been learning for under a month) the views so that they can be displayed in a browser. 我想做的是提供一个更简单的解决方案,其中只有服务器应用程序然后广播(如我所说,我不确定术语,我只学习了不到一个月)就广播了视图,因此它们可以显示在浏览器中。 This not only eliminates the need for a client being installed on every computer displaying a view but also makes it possible to connect several monitors to the same computer, each having a single browser window in fullscreen. 这不仅消除了在每台显示视图的计算机上安装客户端的需要,而且使将多个监视器连接到同一台计算机成为可能,每个监视器都具有一个全屏浏览器窗口。

I also want the program to require almost no computer skills to operate or setup, ie you can just run the installer (or even just copy a folder) and you're good to go. 我还希望该程序几乎不需要任何计算机技能即可操作或设置,即,您只要运行安装程序(甚至只是复制文件夹)就可以了。

The data entry and stuff related to that, ie basically the UI and logic behind it as well as the database and such, I can manage and am already well on the way of creating using WPF and the MVVM pattern. 与此相关的数据输入和内容,即基本上是UI和其背后的逻辑以及数据库等,我可以管理并且已经很好地使用WPF和MVVM模式进行创建。

Now that I have finally finished explaining what I'm trying to do and the requirements I can go on to my questions. 现在,我终于完成了对我要做什么的解释以及可以继续回答我的问题的要求。 After extensive Googling I still haven't found out how I can make my program broadcast the views so that they can be viewed in a browser. 经过广泛的谷歌搜索后,我仍然没有发现如何使程序广播视图,以便可以在浏览器中查看它们。 This is probably mostly because I don't know the correct terms to look for. 这可能主要是因为我不知道要查找的正确术语。

So here are my questions: 所以这是我的问题:

  • Is what I want to do possible (preferably without having to dig too deep). 我想做的就是可能的(最好不必太深地挖掘)。

  • What should I be looking for? 我应该找什么?

  • What would be the best way of doing this? 最好的方法是什么? Remember that the simplicity of the program for the user is my primary focus. 请记住,为用户提供程序的简便性是我的主要重点。

  • Are there any libraries, tools and/or techniques that can help me with this project? 是否有任何库,工具和/或技术可以帮助我完成该项目?

  • Is WPF OK for this or should I be using some kind of web based platform? WPF是否可以解决此问题,或者我应该使用某种基于Web的平台?

  • If so is it possible to have a single installer file that sets everything up like I described before? 如果是这样,是否可以有一个安装程序文件来像我之前描述的那样设置所有内容?

Edit: I forgot to add that I want to type the server's ip address in the browser to get a menu for which view that particular browser window should show. 编辑:我忘了补充一点,我想在浏览器中键入服务器的IP地址以获取菜单,该菜单应显示特定浏览器窗口的视图。

Sounds like you're trying to architect a fairly standard enterprise-type application but it's very difficult to answer this in a single post without knowing any of the many variables you'll inevitably be facing. 听起来您正在尝试构建一个相当标准的企业类型应用程序,但是要在不知道您将不可避免面临的众多变量中的任何一个问题的情况下,很难在一个帖子中回答这个问题。 Oh well, here goes anyway.... 哦,好吧,这里还是....

If you're on a secure sub-net then I'd probably forego a web server altogether along with all the configuration hassles that they entail for naive users. 如果您使用的是安全子网,那么我可能会完全放弃一台Web服务器,以及它们给天真的用户带来的所有配置麻烦。 Create a WPF app and have it create the web server at runtime. 创建一个WPF应用程序,并使其在运行时创建Web服务器。 Clients can shout out a UDP broadcast the first time they run asking all servers to identify themselves, obviously the clients should also have a feature that allows the user the force this at any point in future. 客户端可以在第一次运行时要求所有服务器标识自己的身份,就喊出UDP广播,很明显,客户端还应具有一项功能,允许用户在将来的任何时候强制执行此操作。 As for serving up your data you'll probably want a real-time data stream and for that I'd use web sockets, they're specifically designed for this sort of thing, they're compatible with all the major web browsers (should you ever want browser support in future) and best of all they can be implemented in WPF with a few dozen lines of code. 至于提供数据,您可能需要一个实时数据流,并且为此,我将使用Web套接字,它们是专门为这种事情而设计的,它们与所有主要的Web浏览器兼容(应该您将来可能需要浏览器支持),而最好的方法是可以用几行代码在WPF中实现。 Do it like this and you should be able to provide your clients with standalone WPF applications that they install on the relevant machines that self-configure without any input from the user. 这样做,您应该能够为客户提供独立的WPF应用程序,它们安装在自行配置的相关计算机上,而无需用户输入任何信息。

If your "server" was a web server, the entire application could be a web application. 如果您的“服务器”是Web服务器,则整个应用程序可能是Web应用程序。 Then, your clients would only need a web browser. 然后,您的客户只需要一个Web浏览器。 An ASP.NET application only runs .NET specific code on the server - what is delivered to the client is pure HTML/CSS/JavaScript, etc... With a good design, the clients could be anything (desktops, laptops, tablets, phones, etc...). ASP.NET应用程序仅在服务器上运行.NET特定代码-交付给客户端的是纯HTML / CSS / JavaScript等。通过良好的设计,客户端可以是任何东西(台式机,笔记本电脑,平板电脑,电话等)。

When you talk about broadcasting, it sounds like you want the server to push updates to the clients. 在谈论广播时,听起来好像您希望服务器将更新推送到客户端。 A better approach would be to have the clients (the web pages) request these updates from the server. 更好的方法是让客户端(网页)从服务器请求这些更新。

What I'm trying to do is make a simpler solution where there is only the server application which then broadcasts (...) the views so that they can be displayed in a browser. 我正在尝试做一个简单的解决方案,其中只有服务器应用程序然后广播(...)视图,以便可以在浏览器中显示它们。

eliminates the need for a client being installed on every computer 无需在每台计算机上都安装客户端

I also want the program to require (...) just run the installer (...) and you're good to go. 我也希望程序要求(...)只需运行安装程序(...),您就可以开始了。

All you described can be accomplished with VirtualUI (to web-enable the application) and jsRO to redefine the user interface making it simpler (yet without affecting the original app). 您描述的所有操作都可以通过VirtualUI (启用应用程序的网络功能)和jsRO来重新定义,使其更简单的用户界面(但仍不影响原始应用程序)。

You can find some references on this CodeProject article. 您可以在此CodeProject文章上找到一些参考。

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

相关问题 如何连接桌面应用程序和浏览器? - How to connect desktop application and browser? C#更好的压缩远程桌面广播应用程序 - C# better compression for remote desktop broadcast application 在Windows 8桌面应用程序的默认浏览器中打开URL - Opening a URL in the default browser in a Windows 8 desktop application 使用桌面应用程序控制Web浏览器 - Controling a web browser using a desktop application 使用C#桌面应用程序在默认浏览器中设置Cookie - Set cookie in default browser using c# desktop application 从 C# 桌面应用程序打开浏览器并捕获网页中的参数 - Open Browser from C# Desktop Application and catch parameters in webpage Windows 桌面应用程序从浏览器读取 session 数据 - Windows desktop application read session data from browser 获取从Web浏览器到桌面应用程序C#的链接的地址。 - Get the address of a link from web browser to desktop application C# 如何通过在浏览器中点击URL打开WPF桌面应用程序? - How to open WPF desktop application by hiting URL on browser? 如何在运行时检查或自定义桌面应用程序 - 类似于浏览器检查器 - How inspect or customize a Desktop Application in runtime - similar to browser inspector
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM