向连接到网络的所有计算机显示消息 [英] displaying message to all the computers connected to a network

查看:129
本文介绍了向连接到网络的所有计算机显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在通过lan连接到单个网络的所有PC上显示自定义消息.

How do i display a custom message on all the pc`s connected via lan to a single network.

推荐答案

首先,此功能可以是借助P \ Invoke和WinApi在.NET中可以访问.
一般的worfkflow过程可以分为2个阶段:
1)检索通过lan连接到单个网络的所有PC.
2)向每台PC发送适当的消息.

通过调用以下方法,使用本地Netapi32.dll中的WinApi方法,可以实现工作流的第一部分: -
Hi, first of all this feature can be reachable in .NET with help of P\Invoke and WinApi.
General worfkflow process can be divided on the 2 stages:
1) Retrieving all pc''s connected via lan to a single network.
2) Sending to each pc appropriate message.

First part of workflow can be feasible by using WinApi methods from native Netapi32.dll by calling such methods as:
-
NetServerEnum


-

NetApiBufferFree


以及来自此库的名为_SERVER_INFO_100
的结构
第二阶段将包括以下步骤(从wtsapi32.dll调用方法):
1)通过调用


And structure from this library called _SERVER_INFO_100

Second stage will consists from following steps(calling methods from wtsapi32.dll):
1) Get the handle of remote server by calling

WTSOpenServer


获取远程服务器的句柄 2)通过调用


2) Get the handle of active console session id by calling

WTSGetActiveConsoleSessionId


获取活动的控制台会话ID的句柄 3)在


3) Send message to appropriate server and console session with help of

WTSSendMessage

方法的帮助下,将消息发送到适当的服务器和控制台会话.

就是这样.
祝你好运.

method.

Thats all.
Good luck.


这篇关于向连接到网络的所有计算机显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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