vb.net 可以跨应用程序监视引发事件吗?

发布于 2024-08-06 11:41:06 字数 506 浏览 6 评论 0原文

我可能已经疯了......但我希望有办法做到这一点。

我有一个基类,其中包含事件处理。我的控制台应用程序正在运行我的工作流程。该工作流程的一部分是在单独的线程中以特定的时间间隔引发事件,以广播工作人员的当前状态(我听到很多人称之为心跳)。

我在同一解决方案中还有另一个程序,它是一个 Windows 窗体,我希望它能够监听控制台应用程序中发生的情况,以便它可以显示工作状态。我尝试同时运行两者并验证事件正在触发,但监视器没有找到任何引发的事件。

我担心没有办法做到这一点,我需要使用数据库日志记录方法或其他方法......但万一有人知道如何使用事件(或事件样式)逻辑在应用程序之间进行通信,我将不胜感激。

目前,这些应用程序正在同一位置运行。目标是监视器应用程序最终将与我们网络的广播器连接,以便我们的工作站可以在不登录机器的情况下监视某些工作状态,并且主监视器将向我们显示所有工作人员的完整状态。

如果我需要扩展/澄清这一点,请告诉我,让一个 2 岁的孩子在我输入此内容时观看《星球大战》,这样我可能会错过一些东西。

I may have gone crazy... but I am hoping there is a way to do this.

I have a base class that has event handling in it. My console application is running my workflow. Part of that workflow is to raise events at specific intervals in a separate thread to broadcast the workers' current state (a heartbeat I have heard many call it).

I also have another program in the same solution that is a windows form that I want it to be able to listen to what is going on in the console application so that it can display the worker states. I have tried running both at the same time and verified the events are triggering, but the monitor is not finding any of the raised events.

I am fearing that there is no way to do this, and I will need to go to a database logging method or something else... but in the off chance someone knew how to communicate between applications with event (or event-style) logic, I would appreciate it.

Currently the applications are running from the same location. The goal is that the monitor application will eventually be attached with a broadcaster for our network so that our workstations can monitor for certain worker states without being logged into the machine and the main monitor will show us the full status of all the workers.

Please let me know if I need to expand/clarify this, have a 2-year old watching Star Wars while I type this so I may have missed something.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛装女皇 2024-08-13 11:41:06

有几种方法:使用远程处理、自定义窗口消息和命名管道。一种方法是如何在 Visual Basic .NET 或 Visual Basic 2005 中使用命名管道进行进程间通信

这是一个远程处理示例: 简单交互VB.Net 中的进程通信

下面是自定义 Windows 消息的示例:VB。 NET、VB6 和 C# 通过窗口消息进行进程间通信

也许最“最新”的方法是使用 WCF 回调通道:在 WCF 中使用回调协定进行异步发布/订阅事件式通信

There are several ways: using remoting, custom windows messages and named pipes. One way is How to use named pipes for interprocess communication in Visual Basic .NET or in Visual Basic 2005

Here's a remoting example: Simple Inter-Process Communication In VB.Net

Here an example of custom windows messages: VB.NET, VB6 and C# Interprocess communication via Window Messaging

Perhaps the most 'up-to-date' way is to use WCF Callback Channels: Using Callback Contracts in WCF for Asynchronous Publish/Subscribe Event-Style Communication

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文