创建一个多用户Windows应用程序

编程入门 行业动态 更新时间:2024-10-13 20:15:49
本文介绍了创建一个多用户Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 首先,我要感谢大家互相帮助,并特别帮助我得到答案。 我将开发一个通过在用户之间共享数据库来为许多用户提供服务的Windows应用程序。 其中一个应用程序功能是在两个用户之间滑动项目,因此第一个用户检查(在他的电脑上安装的应用程序)对于特定项目,一旦找到它,他将订购该项目,通知应出现在所有者屏幕上告诉他有人需要这个项目,然后他可以接受拒绝。 问题是如何创建这样的服务,只要PC打开就可以继续监听请求。 我现在使用C#,WPF应用程序,sqlite(我应该使用sql server)为了分享数据?)。 谢谢 我尝试了什么: 我现在没有尝试任何东西,我在等待建议

解决方案

是的,您可以使用SQL Server数据库来共享数据并检测数据更改以推送特定用户的通知。请参阅: SqlDependency类(System.Data.SqlClient) [ ^ ] 使用SqlDependency检测更改Microsoft Docs [ ^ ] 使用SqlDependency进行数据更改事件 [ ^ ] 祝你好运!

As SQL Server 不是最容易安装和管理的数据库,我建议使用 PostgreSQL ,这里有一个介绍:使用PostgreSQL(简介) [ ^ ] 与其他用户讨论通知,这里有一篇CodeProject文章(请注意Maciej :))关于它的示例代码(遗憾的是不是WPF)一个PostgreSQL通知示例 [ ^ ]

Hello guys, First of all I would like to thank you all for helping each other, and specially helping me to get my answers. I am going to develop a windows application that serves many users by sharing the database between users. One of the application functions is to swipe items between two users, so the first user check (on the application installed on his pc) for specific item once he find it, he will order the item, a notification should appear on the owner Screen to tell him that someone need this item, then he can do accept ot reject. The question is how to create such service that stay listening for requests as long as the PC ON. I use C#, WPF application, sqlite for now ( i should use sql server in order to share data?). Thanks What I have tried: I didn’t try anything for now, i am waiting for suggestions

解决方案

Yes, you can use SQL server database to share data and detect data changes to push notification for specific user. See: SqlDependency Class (System.Data.SqlClient)[^] Detecting Changes with SqlDependency | Microsoft Docs[^] Using SqlDependency for data change events[^] Good luck!

As SQL Server is not the easiest database to install and manage, I would recommend using PostgreSQL instead, here is an introduction: Using PostgreSQL in your C# (.NET) application (An introduction)[^] Talking about notifications to other users, here is an CodeProject article (take note Maciej :)) about it with example code (sadly not WPF) A PostgreSQL Notification Example[^]

更多推荐

创建一个多用户Windows应用程序

本文发布于:2023-10-24 21:07:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1525007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多用户   创建一个   应用程序   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!