简体   繁体   English

从C#winform应用程序向其他用户发送通知?

[英]Send notification from C# winform application to another user?

I have created an aplication using c# winforms and database sql server 2008 R2. 我已经使用c#winforms和数据库sql server 2008 R2创建了一个应用程序。

This application will be installed on 10 machines. 该应用程序将安装在10台计算机上。

Database is installed on server which interacts with all the users. 数据库安装在与所有用户进行交互的服务器上。

Now one user(Admin) want to send a notification on button click to all the 9 users if a particular table in the database is inserted with a record. 现在,如果数据库中的特定表插入了一条记录,则一个用户(管理员)希望在单击按钮时向所有9个用户发送通知。

And all 9 users will get the notification in the label to "Please update." 并且所有9位用户将在标签中收到“请更新”的通知。

Can any body help me with this. 任何人都可以帮我这个忙。

Thanks.. 谢谢..

You can use the SqlDependency class to do this, it requires Service Broker, but handles most of it for your automatically; 您可以使用SqlDependency类来执行此操作,它需要Service Broker,但会为您自动处理其中的大多数操作。 once setup, your application will fire an event when a watched table changes. 一旦设置,您的应用程序将在监视表更改时触发事件。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM