Good day,
I am new to .NET and I am accessing .NET through Wolfram Mathematica with NETLink package. I need to define a .NET function that returns information whether the process with given ID still exists.
A typical way to define a .NET function through NETLink is as follows:
Needs["NETLink`"];
LoadNETType["System.Diagnostics.Process"];
killProc[procID_] := (
proc = Process`GetProcessById[procID];
proc@Kill[]
);
The above code defines the function killProc[procID] that kills the process with ID procID. How to define a function that just checks whether the process that had this ID before is still exists or not? The definitions for this function probably should be done at the moment when the process still exists. And at some moment later I just wish to check whether it still exists or not.
The solution is to use the property
HasExited:This is what I searched for.