代码收藏

// constants used to select the performance counter.
  private const string CategoryName = "Processor";
  private const string CounterName = "% Processor Time";
  private const string InstanceName = "_Total";
    PerformanceCounter pc = new PerformanceCounter(CategoryName,CounterName,InstanceName);
    Response.Write(pc.CounterType+"<br>"+pc.CounterHelp+"<br>"+pc.NextValue());

你可能感兴趣的:(代码)