【发布时间】:2018-11-04 13:34:44
【问题描述】:
所以最近我有了一个想法,我可以构建一个可以远程监控计算机性能的应用程序,例如:CPU 和 GPU 使用情况、CPU 和 GPU 温度以及 RAM 使用情况。
这个应用程序可以让人们检查电脑的性能,如果它在他们外出时处于渲染状态,或者如果他们在玩游戏并且不喜欢像 MSI 加力燃烧器那样将数据放在角落里的想法。
我使用 C# 构建了一个简单的 Windows 窗体应用程序,它每秒从性能监视器中提取数据并将其显示在表单中。这是代码
using System;
using System.Windows.Forms;
using System.Diagnostics;
namespace cpu_monitor
{
public partial class Monitor : Form
{
PerformanceCounter perfCPUCounter = new PerformanceCounter("Processor Information","% Processor Time", "_Total");
PerformanceCounter perfMEMCounter = new PerformanceCounter("Memory", "Available MBytes");
PerformanceCounter perfSYSTEMCounter = new PerformanceCounter("System", "System Up Time");
public Monitor()
{
InitializeComponent();
}
private void Monitor_Load(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
CPU_label.Text = "CPU: " + " " + (int)perfCPUCounter.NextValue() + " " + "%" ;
MEMORY_label.Text = "Available Memory: " + " " + (int)perfMEMCounter.NextValue() + " " + "MB";
SYSTEM_label.Text = "System up time: " + " " + (int)perfSYSTEMCounter.NextValue()/60/60 + " " +"Hours";
}
}
}
我现在唯一的问题是如何将这些数据发送到 ios 或 android 等平台上的接收应用程序。
我的主要问题是它的物流。我是否必须将数据发送到服务器,然后使用应用程序从服务器中提取数据,或者我可以使用网站进行操作。 或者有没有人有其他想法。 我正在将 c# 用于 pc 程序,但我不知道该应用程序。 任何帮助将不胜感激。 谢谢,理查德。
【问题讨论】:
-
我不知道该使用什么语言
-
不幸的是,这是一个非常广泛的问题。设备之间的通信方式有很多种,具体取决于设备是否需要在同一个网络或外部工作,等等。因此,我认为这不适合 SO。