简体   繁体   English

使用EventWaitHandle类

[英]Using EventWaitHandle class

in Process AI need to receive an event from Proces B. I decided to use EventWaitHandle. 在流程AI中,需要从Proces B接收事件。我决定使用EventWaitHandle。 In both processes i write this code: 在这两个过程中,我都编写以下代码:

var evhandle = new EventWaitHandle(false, EventResetMode.AutoReset,"MyGUID1221");

then in process A i invoke Set() method: 然后在进程A中,我调用Set()方法:

evhandle.Set();

How i can to receive "MyGUID1221" event in process B and do some actions? 我如何在进程B中接收“ MyGUID1221”事件并执行一些操作? How to make "MyGUID1221"Listener? 如何制作“ MyGUID1221”监听器?

Thanks. 谢谢。

The "MyGUID121" is just the name for the system-wide event. “ MyGUID121”只是系统范围事件的名称。 You listen (read wait) for the event by using the WaitOne - method 通过使用WaitOne-方法监听 (读取等待)事件

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

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