foreach (Process p in Process.GetProcesses())
{
ramCounter = new PerformanceCounter("Memory", "% Committed Bytes In Use", p.ProcessName);
try
{
PerformanceCounter myAppCpu = new PerformanceCounter("Process", "% Processor Time", p.ProcessName, true);
myAppCpu.NextValue();
Thread.Sleep(100);
Program.ProcessList.Add(
new ProcessInfo(
p.MainModule.ModuleName,
p.Id,
p.HandleCount,
myAppCpu.NextValue(),
p.PrivateMemorySize64, //PrivateMemorySize: The number of bytes that the associated process has allocated that cannot be shared with other processes.
p.WorkingSet64,
p.PeakVirtualMemorySize64, //PeakVirtualMemorySize: The maximum amount of virtual memory that the process has requested.
p.PeakPagedMemorySize64, //PeakPagedMemorySize: The maximum amount of memory that the associated process has allocated that could be written to the virtual paging file.
p.PagedSystemMemorySize64, //PagedSystemMemorySize: The amount of memory that the system has allocated on behalf of the associated process that can be written to the virtual memory paging file.
p.PagedMemorySize64, //PagedMemorySize: The amount of memory that the associated process has allocated that can be written to the virtual memory paging file.
p.NonpagedSystemMemorySize64)); //NonpagedSystemMemorySize: The amount of memory that the system has allocated on behalf of the associated process that cannot be written to the virtual memory paging file.
}
catch (Exception) { }
}
问题出现在第二个" catch"尝试InitializeAsync mediaCapture时的语句。
如果它没有提供任何错误详情,我如何查看错误?