开发者

Get object information in a running process

开发者 https://www.devze.com 2023-01-06 18:55 出处:网络
I have a vb.net application which runs as a service. I also have another Windows application that serves as the service interface.

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 communicatin开发者_StackOverflowg 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消