amanda112

群里一小伙伴在开发APP时遇到了问题,便截图提问

一、傻瓜式解决办法:

  删除:

  ((System.ComponentModel.ISupportInitialize)(this.performanceCounter1)).EndInit();

  这个办法虽然简单,但是会出错。

  原因是,当你添加performanceCounte之类的控件时,它会要求生成CategoryName,但VS突然犯傻,没有Zion给生成CategoryName,所以报了错。(CategoryName指的就是控件要用的名字)

 

二、妥善的解决办法

  在Form1.Designer中添加
    this.performanceCounter1.CategoryName = "Processor";
    this.performanceCounter1.CounterName = "% Processor Time";
    this.performanceCounter1.InstanceName = "_Total";

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2021-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案