获取正在运行的进程中的对象信息

发布于 2024-09-08 15:39:35 字数 703 浏览 7 评论 0原文

我有一个作为服务运行的 vb.net 应用程序。我还有另一个 Windows 应用程序作为服务接口。

简而言之,该服务会监视某些文件夹中的新文件并将它们导入到各种数据库中。在服务中,我有一个名为“importFile”的类,其中包含“FileName”和“ImportStatus”等基本属性。对于每个新的传入文件,我都会创建一个“importFile”的新实例,并将其添加到名为 myFiles 的列表对象中,该对象的类型为:List (of importFile)。

目前,在我的服务中,我将一些对象详细信息(例如 ImportStatus)写入 XML 配置文件,该文件又由服务接口应用程序读取。

我想从服务向接口公开更多信息,而通过 xml 进行通信感觉并不是最有效的方法。

我的问题是如何向界面应用程序公开活动对象,例如服务中的“myFiles”?我认为这可以通过 Process 类来完成,但到目前为止我所有的努力都失败了。

我认为解决方案可能如下所示,但我不太确定我在做什么,并且可能会很遥远:

Dim myProcess() As Process = Process.GetProcessesByName("ImportApp", ".")
Dim fileList As List (of importFile) = myProcess(0).GetObjectRef( ??????????? )

任何帮助将不胜感激,谢谢。

I have a vb.net application which runs as a service. I also have another Windows application that serves as the service interface.

In brief the service watches some folders for new files and imports them into various databases. In the service I have an class called 'importFile' containing basic properties such as 'FileName' and 'ImportStatus'. With each new incoming file I create a new instance of 'importFile' and add it to a list object called myFiles which is of the type: List (of importFile).

Currently in my service im writing a few object details (such as ImportStatus) to an XML config file which is in turn read by the service interface application.

I want to expose more information from the service to the interface, and communicating via xml doesn't feel like its the most efficient method.

My question is how do I expose live objects, such as 'myFiles' in my service to my interface application? I think this can be done via the Process class but all my efforts have so far failed.

I'm thinking that the solution may look something like the following, but im not too sure what im doing and could be way off:

Dim myProcess() As Process = Process.GetProcessesByName("ImportApp", ".")
Dim fileList As List (of importFile) = myProcess(0).GetObjectRef( ??????????? )

Any help would be greatly appreciated, thanks.

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

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

发布评论

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

评论(1

深空失忆 2024-09-15 15:39:35

如果您的服务是用 .NET 编写的,您可以使用 远程处理< /a> 公开您的服务对象,详细信息请参见此处

If your service is written in .NET you can use remoting to expose your service's objects as detailed here.

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