0
I’m making a resource monitoring software and I’m having trouble getting it to identify the largest number.
public string max()
{
System.Diagnostics.Process[] ieProcs = Process.GetProcessesByName("devenv");
double avvv = 0;
string abi = null;
if (ieProcs.Length > 0)
{
foreach (System.Diagnostics.Process p in ieProcs)
{
String virtualMem = p.VirtualMemorySize64.ToString();
String physicalMem = p.WorkingSet64.ToString();
String cpu = p.TotalProcessorTime.ToString();
abi = physicalMem;
}
}
avvv = double.Parse(abi);
avvv = avvv * 0.001 / 1024;
return avvv.ToString();
}
above the code I would like to capture the largest number, this is a code that monitors the use of ram memory of the process, just like does the Windows task manager, only I want to get the peak at the time when the process uses the largest contity of ram memory. The values are dynamic and whenever it changes to a higher one I want it to change to the maximum value.
That way I’d like him to show off.
Behold this
– ramaral
It seems logical to compare the next foreach value with the previous result and update the textbox if the new value is higher. You can take this test?
– Vanderlei