static string NetworkName = new PerformanceCounterCategory("Network Interface").GetInstanceNames()[];//获取网卡名称
PerformanceCounter NetworkR = new PerformanceCounter("Network Interface", "Bytes Received/sec", NetworkName);//获取网络接收速度
PerformanceCounter NetworkS = new PerformanceCounter("Network Interface", "Bytes Sent/sec", NetworkName);
PerformanceCounter cpu = new PerformanceCounter("Processor", "% Processor Time", "_Total");///CPU性能计数器 toolStripStatusLabel3.Text = "接收:" + (NetworkR.NextValue() / / ).ToString("0.00") + "mb/s 发送:" + (NetworkS.NextValue() / / ).ToString("0.00") + "mb/s";
toolStripStatusLabel5.Text = "CPU:" + cpu.NextValue().ToString("") + "%";

获取网卡速率,cpu使用率的更多相关文章

  1. Java获取Linux系统cpu使用率

    原文:http://www.open-open.com/code/view/1426152165201 import java.io.BufferedReader; import java.io.Fi ...

  2. 获取Windows操作系统的CPU使用率以及内存使用率

    此功能参考了ProcessHacker项目的代码. 声明定义 typedef struct _UINT64_DELTA { ULONG64 Value; ULONG64 Delta; } UINT64 ...

  3. python获取每颗cpu使用率

    以下是关于python来获取服务器每颗CPU使用率的使用脚本. #!/usr/bin/env python # -*- coding: utf-8 -*- import re,time def _re ...

  4. [No0000112]ComputerInfo,C#获取计算机信息(cpu使用率,内存占用率,硬盘,网络信息)

    github地址:https://github.com/charygao/SmsComputerMonitor 软件用于实时监控当前系统资源等情况,并调用接口,当资源被超额占用时,发送警报到个人手机: ...

  5. Golang利用第三方包获取本机cpu使用率以及内存使用情况

    第三方包下载 $ github.com/shirou/gopsutil 获取内存方面的信息 package main import ( "fmt" "github.com ...

  6. 使用shell脚本获取虚拟机中cpu使用率(读/proc/statc)

    #!/bin/bash interval= cpu_num=`-] -c` start_idle=() start_total=() cpu_rate=() cpu_rate_file=./`host ...

  7. vc获取当前进程CPU使用率

    double GetCPUUserRate() { HANDLE hProcess=::GetCurrentProcess(); static DWORD s_dwTickCountOld = 0; ...

  8. shell 获取cpu使用率

    1.shell脚本获取主机每颗CPU使用率的方法. #!/bin/bash interval= cpu_num=`-] -c` start_idle=() start_total=() cpu_rat ...

  9. shell脚本之获取CPU使用率

    今天一个同事要测试OJ项目,同时我这边也需要知道他在压测过程中, CPU的使用率怎么样,虽说可以用top实时查看,但是进程太多了,我不需要获取那么多信息,我仅仅只要知道当前压测过程中CPU实时的使用率 ...

随机推荐

  1. nginx.conf and dockerfile带颜色

    wget http://www.vim.org/scripts/download_script.php?src_id=14376 -O nginx.vim mv nginx.vim /usr/shar ...

  2. 刨根究底字符编码之十——Unicode字符集的编码方式以及码点、码元

    Unicode字符集的编码方式以及码点.码元 一.字符编码方式CEF的选择 1. 由于Unicode字符集非常大,有些字符的编号(码点值)需要两个或两个以上字节来表示,而要对这样的编号进行编码,也必须 ...

  3. GTID复制

    什么是GTID呢, 简而言之,就是全局事务ID(global transaction identifier ),最初由google实现,官方MySQL在5.6才加入该功能.GTID是事务提交时创建分配 ...

  4. 本地连接Linux工具

    连接Linux命令 finaXshell 工具好用: 链接:https://pan.baidu.com/s/13yyOhi7GzcZNTxXseGO_fA 提取码:n4t6 上次Linux 文件工具: ...

  5. go 拼接sql

    //原文链接:https://www.jianshu.com/p/a0569157c418 golang mysql拼接子查询 使用fmt.Sprintf拼接SQL 实例代码 func Select( ...

  6. Python 最常见的 170 道面试题解析:2019 最新

    Python 最常见的 170 道面试题解析:2019 最新 2019年06月03日 23:30:10 GitChat的博客 阅读数 21329 文章标签: PythonPython入门Python面 ...

  7. the specified service is marked as deletion,can not find the file specified

    使用命令注册windows service sc create CCGSQueueService binpath= "D:\DKX4003\services\xxx.xx.xx\xxx.ex ...

  8. 树莓派SD卡安装系统后扩容——实测简单高效

    接上一篇博客安装了树莓派64位的系统,如果需要安装桌面等其他操作会面临文件系统分区空间紧张的局面,扩容方法如下: 在ubuntu上安装 gparted工具可以对SD卡重新分区 $sudo apt-ge ...

  9. JS基础_对象字面量

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. CSS模块化:less

    less的安装与基本使用 less的语法及特性 一.本地使用less的方法 Less (Leaner Style Sheets 的缩写) 是一门向后兼容的 CSS 扩展语言.是一种动态样式语言,属于c ...