资源简介
C#代码实时监控CPU温度、CPU占用率、显卡温度、GPU占用率、风扇转速、内存使用率、磁盘读写速率等硬件信息
代码片段和文件信息
/*
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the “License“); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an “AS IS“ basis
WITHOUT WARRANTY OF ANY KIND either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Original Code is the Open Hardware Monitor code.
The Initial Developer of the Original Code is
Michael Möller .
Portions created by the Initial Developer are Copyright (C) 2009-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Alternatively the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the “GPL“) or
the GNU Lesser General Public License Version 2.1 or later (the “LGPL“)
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL and not to allow others to
use your version of this file under the terms of the MPL indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above a recipient may use your version of this file under
the terms of any one of the MPL the GPL or the LGPL.
*/
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using OpenHardwareMonitor.GUI;
namespace OpenHardwareMonitor {
public static class Program {
[STAThread]
public static void Main() {
#if !DEBUG
Application.ThreadException +=
new ThreadExceptionEventHandler(Application_ThreadException);
Application.SetUnhandledExceptionMode(
UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
#endif
if (!AllRequiredFilesAvailable())
Environment.Exit(0);
Application.EnableVisualstyles();
Application.SetCompatibleTextRenderingDefault(false);
using (GUI.MainForm form = new GUI.MainForm()) {
form.FormClosed += delegate(object sender FormClosedEventArgs e) {
Application.Exit();
};
Application.Run();
}
}
private static bool IsFileAvailable(string fileName) {
string path = Path.GetDirectoryName(Application.ExecutablePath) +
Path.DirectorySeparatorChar;
if (!File.Exists(path + fileName)) {
MessageBox.Show(“The following file could not be found: “ + fileName +
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-09-09 17:12 OpenHardware\
文件 192 2012-05-23 18:45 OpenHardware\App.config
目录 0 2012-06-06 13:56 OpenHardware\Bin\
目录 0 2012-05-27 03:04 OpenHardware\Bin\Debug\
文件 146432 2012-05-23 18:45 OpenHardware\Bin\Debug\Aga.Controls.dll
文件 1357 2012-05-23 18:45 OpenHardware\Bin\Debug\Aga.Controls.License.txt
文件 29350 2012-05-27 01:08 OpenHardware\Bin\Debug\OpenHardwareMonitor.config
文件 217088 2012-05-27 03:46 OpenHardware\Bin\Debug\OpenHardwareMonitor.exe
文件 192 2012-05-23 18:45 OpenHardware\Bin\Debug\OpenHardwareMonitor.exe.config
文件 26225 2012-05-23 18:45 OpenHardware\Bin\Debug\OpenHardwareMonitor.License.txt
文件 310784 2012-05-27 03:46 OpenHardware\Bin\Debug\OpenHardwareMonitor.pdb
文件 11608 2012-05-27 01:12 OpenHardware\Bin\Debug\OpenHardwareMonitor.vshost.exe
文件 192 2012-05-23 18:45 OpenHardware\Bin\Debug\OpenHardwareMonitor.vshost.exe.config
文件 274944 2012-05-27 02:36 OpenHardware\Bin\Debug\OpenHardwareMonitorLib.dll
文件 534016 2012-05-27 02:36 OpenHardware\Bin\Debug\OpenHardwareMonitorLib.pdb
文件 1274 2012-05-23 18:45 OpenHardware\Bin\Debug\WinRing0.License.txt
目录 0 2012-05-27 03:04 OpenHardware\Bin\Release\
文件 146432 2012-05-23 18:45 OpenHardware\Bin\Release\Aga.Controls.dll
文件 1357 2012-05-23 18:45 OpenHardware\Bin\Release\Aga.Controls.License.txt
文件 16473 2015-12-22 11:08 OpenHardware\Bin\Release\OpenHardwareMonitor.config
文件 205824 2020-09-09 17:08 OpenHardware\Bin\Release\OpenHardwareMonitor.exe
文件 192 2012-05-23 18:45 OpenHardware\Bin\Release\OpenHardwareMonitor.exe.config
文件 26225 2012-05-23 18:45 OpenHardware\Bin\Release\OpenHardwareMonitor.License.txt
文件 233984 2020-09-09 17:08 OpenHardware\Bin\Release\OpenHardwareMonitorLib.dll
文件 1274 2012-05-23 18:45 OpenHardware\Bin\Release\WinRing0.License.txt
目录 0 2012-05-27 03:04 OpenHardware\Collections\
目录 0 2012-05-27 03:04 OpenHardware\Collections\.svn\
文件 600 2012-05-23 18:45 OpenHardware\Collections\.svn\all-wcprops
文件 996 2012-05-23 18:45 OpenHardware\Collections\.svn\entries
目录 0 2012-05-27 01:44 OpenHardware\Collections\.svn\prop-ba
目录 0 2012-05-27 01:44 OpenHardware\Collections\.svn\props\
............此处省略578个文件信息
评论
共有 条评论