How do I run an executable file with limited time and memory usage?
1 answer
You can use Thread to track the executable you are executing.
var process = Process.Start("Test.exe");
// Monitor - Use this property to monitor the memory
process.MainModule.ModuleMemorySize
// Monitor - Use this property to monitor the time
process.StartTime
// Limit - You can use this property to limit the executable memory size,
// but I wouldn't recommend it...
process.MaxWorkingSet
Good luck.
+5
source to share