I have a lan network of simulation games room. all the statistics saves on a ms server db.
我有一个模拟游戏室的局域网网络。所有统计信息都保存在ms服务器db上。
I am searching for an easy way to send a query result to all the computers in the lan network.
我正在寻找一种简单的方法将查询结果发送到局域网中的所有计算机。
Something like - when I run some script or application. all the players will get a pop up screen with the query result like - number of kills, number of team deads, etc.
类似的东西 - 当我运行一些脚本或应用程序时。所有玩家将获得一个弹出屏幕,其中包含查询结果,例如:杀人次数,团队死亡人数等。
There is an easy way to do it? with c#, batch file, python, some downloadable application or any other way?
有一个简单的方法吗?使用c#,批处理文件,python,一些可下载的应用程序或任何其他方式?
EDIT: All the computers has windows 7
编辑:所有的计算机都有Windows 7
2 个解决方案
#1
2
If you only want to send information, without any backchannel and without any other requirements, Windows has a tool to send messages to users or computers over the network.
如果您只想发送信息,没有任何反向通道,也没有任何其他要求,Windows有一个工具通过网络向用户或计算机发送消息。
Net Send. It should already be installed on Windows machines, all you have to do is use it.
网络发送。它应该已经安装在Windows机器上,您所要做的就是使用它。
#2
1
Ultimately, this is the same as sending any message between computers. There are various approaches, but most commonly:
最终,这与在计算机之间发送任何消息相同。有各种方法,但最常见的是:
- have the app poll intermittently
- use a broadcast mechanism
- use a pub/sub mechanism
让间歇性的app轮询
使用广播机制
使用pub / sub机制
I'm a big fan of the last, which can be done trivially with redis. Just have the client apps create a redis connection and subscribe to a named channel:
我是最后一个粉丝的粉丝,可以用redis轻松完成。只需让客户端应用程序创建一个redis连接并订阅一个命名通道:
sub.Subscribe("AWOOGA", (channel, message) => {
DoSomethingWith((string)message);
});
and have one of the nodes publish:
并让其中一个节点发布:
sub.Publish("AWOOGA", "Launch the missiles!");
That's it. The above examples are using the StackExchange.Redis client library available on NuGet. You will need a redis server, but that is also freely available on NuGet.
而已。以上示例使用NuGet上提供的StackExchange.Redis客户端库。您将需要一台redis服务器,但在NuGet上也可以免费使用。
#1
2
If you only want to send information, without any backchannel and without any other requirements, Windows has a tool to send messages to users or computers over the network.
如果您只想发送信息,没有任何反向通道,也没有任何其他要求,Windows有一个工具通过网络向用户或计算机发送消息。
Net Send. It should already be installed on Windows machines, all you have to do is use it.
网络发送。它应该已经安装在Windows机器上,您所要做的就是使用它。
#2
1
Ultimately, this is the same as sending any message between computers. There are various approaches, but most commonly:
最终,这与在计算机之间发送任何消息相同。有各种方法,但最常见的是:
- have the app poll intermittently
- use a broadcast mechanism
- use a pub/sub mechanism
让间歇性的app轮询
使用广播机制
使用pub / sub机制
I'm a big fan of the last, which can be done trivially with redis. Just have the client apps create a redis connection and subscribe to a named channel:
我是最后一个粉丝的粉丝,可以用redis轻松完成。只需让客户端应用程序创建一个redis连接并订阅一个命名通道:
sub.Subscribe("AWOOGA", (channel, message) => {
DoSomethingWith((string)message);
});
and have one of the nodes publish:
并让其中一个节点发布:
sub.Publish("AWOOGA", "Launch the missiles!");
That's it. The above examples are using the StackExchange.Redis client library available on NuGet. You will need a redis server, but that is also freely available on NuGet.
而已。以上示例使用NuGet上提供的StackExchange.Redis客户端库。您将需要一台redis服务器,但在NuGet上也可以免费使用。