我有一个 C# Windows 窗体应用程序。可以部署在web上,让用户可以通过web访问吗?

发布于 2024-10-09 20:54:54 字数 312 浏览 0 评论 0原文

我们使用 C#(.NET 2.0、Visual Studio 2005)完成了一个基于 Windows 的应用程序。现在重做这个基于网络的应用程序是一个耗时和资源消耗的过程,这对我来说几乎是不可能的。

我们需要托管它,以便用户可以通过互联网访问。

通过RDP用户可以访问Windows应用程序,但这里的问题是更多用户无法同时操作。

它可以作为 Web 应用程序托管,以便用户可以通过浏览器访问它吗?

We have done a Windows based application useing C# (.NET 2.0, Visual Studio 2005). Now redoing this application web based, is a time and resource consuming process and which is next to impossible for me.

We need to host this, so that the user can access through the Internet.

Through RDP the user can access the Windows application, but the issues here is more users can not operate simultaneously.

Can it be hosted as a web application, so that the user can access it through browser?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

执笏见 2024-10-16 20:54:54

不,您不能像网站那样直接通过网络提供它,Windows 窗体应用程序直接在客户端计算机上运行。

您可以做的就是将其打包为 MSI 安装程序,以便最终用户可以轻松安装它,然后通过 Internet 访问数据库等资源(公开这些资源的最简单方法是作为 Web 服务)。如果您选择使用此机制,那么您只需重构应用程序的一部分,假设您已经将其很好地构建为 n 层 应用程序。

请注意,用户不必通过 Internet 访问这些资源 - 您提到使用 RDP 的用户表明您将其放在 Intranet 上,这意味着您可以“托管”服务,例如数据库所有客户端都可以通过网络看到(和访问)的机器。在这种情况下,可能需要的只是更改应用程序配置文件中可能存在的任何连接字符串或路径。

No, you cannot make it available directly via the web as you would a website, Windows Forms applications run directly on the client machine.

What you can do is package it up as an MSI installer, so that the end user can easily install it, and then have access resources such as a database via the Internet (the simplest way to expose these resources is as a web service). If you choose to use this mechanism then you will only have to refactor part of your application, assuming that you have already structured it nicely into an n-tier application.

Note that the user doesn't have to access these resources via the Internet though - your mention of users employing RDP would suggest that you have it sitting on an intranet, which means you may be able to "host" services such as a database on an machine that all the clients can see (and access) across the network. In this case all that may be required is to change any connection strings or paths you may have sitting in the configuration file of the application.

谜泪 2024-10-16 20:54:54

您至少可以使用 ClickOnce 通过网络部署它

ClickOnce 部署使您能够将基于 Windows 的应用程序发布到 Web 服务器或网络文件共享以简化安装。 Visual Studio 为使用 ClickOnce 技术部署的应用程序的发布和更新提供全面支持。

http://msdn.microsoft.com/en-我们/库/t71a733d(v=VS.90).aspx

You could at least deploy it via the web using ClickOnce

ClickOnce deployment enables you to publish Windows-based applications to a Web server or network file share for simplified installation. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology.

http://msdn.microsoft.com/en-us/library/t71a733d(v=VS.90).aspx

笑梦风尘 2024-10-16 20:54:54

您可以使用单击一次的方式通过网络部署您的应用程序,并通过它支持更新,但我不知道有什么方法可以将 winform 应用程序转换为基于 Web 的应用程序,而且我真的怀疑是否有人考虑到两个平台。

You can deploy your application through the network using click-once and support updates trough it but I don't know any way to transform a winform application into a web-based application and I really doubt there is one considering the fundamental architecture changes between the two plaforms.

避讳 2024-10-16 20:54:54

如果您在 Windows 中使用数据库应用程序,那么您可以做一件事。您可以将数据库部署在服务器上,但您希望在 ASP.NET 中为其设计一个前端应用程序,以便您可以在安装您的应用程序的计算机上使用您的 Windows 应用程序,并且所有其他人也可以访问它通过网络。

If you are using a database application in Windows then you can do one thing. You can deploy the database on the server, but you want to design a front-end application in ASP.NET for it, so that you can use your Windows application on the machine where you installed your application, and all others can also access it through the web.

逐鹿 2024-10-16 20:54:54

我建议投入一些时间并修改架构以采用 SOA

您应该重组代码并创建一个 Web 服务,向客户端公开方法。这些方法将从客户端获取输入,执行操作并将数据返回给 UI。您可以从现有解决方案中选择核心业务逻辑类并按原样重用它们。将表示逻辑与业务逻辑分离可能需要付出一些努力,但这是值得的。

托管 Web 服务后,您可以将其与桌面应用程序或 Web 应用程序一起使用。当然,您需要为 Web 应用程序编写 UI 代码,但这比从头开始编写要容易得多。

I would recommend investing some time and modify the architecture to adopt SOA.

You should restructure your code and create a web service that would expose methods to the clients. These methods would take input from the client, perform operations and give back the data to display to the UI. You can pick your core business logic classes from the existing solution and reuse them as is. There might some amount of effort involved to separate out presentation logic from the business logic, but it would well worth the effort.

Once you have your web service` hosted, you can use it with either a desktop application, or a web application. Of course, you would need to code the UI for Web application, but it would be much easlier than writing it from scratch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文