创建一个多用户Windows应用程序 [英] Create a multi user windows application

查看:112
本文介绍了创建一个多用户Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

首先,我要感谢大家互相帮助,并特别帮助我得到答案。



我将开发一个通过在用户之间共享数据库来为许多用户提供服务的Windows应用程序。

其中一个应用程序功能是在两个用户之间滑动项目,因此第一个用户检查(在他的电脑上安装的应用程序)对于特定项目,一旦找到它,他将订购该项目,通知应出现在所有者屏幕上告诉他有人需要这个项目,然后他可以接受拒绝。

问题是如何创建这样的服务,只要PC打开就可以继续监听请求。

我现在使用C#,WPF应用程序,sqlite(我应该使用sql server)为了分享数据?)。

谢谢



我尝试了什么:



我现在没有尝试任何东西,我在等待建议

解决方案

< blockquote>是的,您可以使用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应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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