• 大小: 9.80M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: CPU  c  SignalR  推送  RSA  

资源简介

使用SignalR实时推送CPU使用率SignalrSample

资源截图

代码片段和文件信息

using Microsoft.AspNet.SignalR.Client;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Collector
{
    class Program
    {
        static void Main(string[] args)
        {
            var hubConnection = new HubConnection(“http://localhost:10282/“);
            IHubProxy hubProxy = hubConnection.CreateHubProxy(“MessageHub“);
            hubConnection.Start().Wait();

            PerformanceCounter cpuCounter = new PerformanceCounter
            {
                CategoryName = “Processor“
                CounterName = “% Processor Time“
                InstanceName = “_Total“
            };

            while (true)
            {
                string cpuU

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-07-08 15:49  SignalrSample\Collector\
     文件         189  2015-07-08 15:31  SignalrSample\Collector\App.config
     目录           0  2015-07-08 15:49  SignalrSample\Collector\bin\
     目录           0  2015-07-08 15:49  SignalrSample\Collector\bin\Debug\
     文件        5632  2015-07-08 15:45  SignalrSample\Collector\bin\Debug\Collector.exe
     文件         189  2015-07-08 15:31  SignalrSample\Collector\bin\Debug\Collector.exe.config
     文件       13824  2015-07-08 15:45  SignalrSample\Collector\bin\Debug\Collector.pdb
     文件       23168  2015-07-08 15:47  SignalrSample\Collector\bin\Debug\Collector.vshost.exe
     文件         189  2015-07-08 15:31  SignalrSample\Collector\bin\Debug\Collector.vshost.exe.config
     文件         490  2013-06-18 20:28  SignalrSample\Collector\bin\Debug\Collector.vshost.exe.manifest
     文件      144568  2015-07-08 15:34  SignalrSample\Collector\bin\Debug\Microsoft.AspNet.SignalR.Client.dll
     文件       56036  2015-07-08 15:34  SignalrSample\Collector\bin\Debug\Microsoft.AspNet.SignalR.Client.xml
     文件      502272  2015-07-08 15:34  SignalrSample\Collector\bin\Debug\Newtonsoft.Json.dll
     文件      478726  2015-07-08 15:34  SignalrSample\Collector\bin\Debug\Newtonsoft.Json.xml
     文件        3170  2015-07-08 15:36  SignalrSample\Collector\Collector.csproj
     目录           0  2015-07-08 15:49  SignalrSample\Collector\obj\
     目录           0  2015-07-08 15:49  SignalrSample\Collector\obj\Debug\
     文件         981  2015-07-08 15:47  SignalrSample\Collector\obj\Debug\Collector.csproj.FileListAbsolute.txt
     文件        5632  2015-07-08 15:45  SignalrSample\Collector\obj\Debug\Collector.exe
     文件       13824  2015-07-08 15:45  SignalrSample\Collector\obj\Debug\Collector.pdb
     文件        7034  2015-07-08 15:34  SignalrSample\Collector\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2015-07-08 15:31  SignalrSample\Collector\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2015-07-08 15:31  SignalrSample\Collector\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2015-07-08 15:31  SignalrSample\Collector\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2015-07-08 15:31  SignalrSample\Collector\obj\Debug\TempPE\
     文件         236  2015-07-08 15:34  SignalrSample\Collector\packages.config
     文件        1155  2015-07-08 15:45  SignalrSample\Collector\Program.cs
     目录           0  2015-07-08 15:49  SignalrSample\Collector\Properties\
     文件        1342  2015-07-08 15:31  SignalrSample\Collector\Properties\AssemblyInfo.cs
     目录           0  2015-07-08 15:49  SignalrSample\packages\
     目录           0  2015-07-08 15:49  SignalrSample\packages\flot.0.8.3\
............此处省略412个文件信息

评论

共有 条评论