我正在尝试使用内存性能计数器:
System.Diagnostics.PerformanceCounter theMemCounter =
new System.Diagnostics.PerformanceCounter("Memory", "Available MBytes",
System.Diagnostics.Process.GetCurrentProcess().ProcessName, true);
var memStart = theMemCounter.NextValue();
但在第二行中,我收到以下错误:
Counter is single instance, instance name 'WebDev.WebServer40' is not valid for this counter category.
问题是什么?