summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs
new file mode 100644
index 000000000..86a97ca11
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Functions/SystemInfo.cs
@@ -0,0 +1,60 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SystemInfo.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The System Information.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Functions
+{
+ using System.Windows.Forms;
+
+ using Microsoft.Win32;
+
+ /// <summary>
+ /// The System Information.
+ /// </summary>
+ public class SystemInfo
+ {
+ /// <summary>
+ /// Gets the total physical ram in a system
+ /// </summary>
+ /// <returns>The total memory in the system</returns>
+ public static ulong TotalPhysicalMemory
+ {
+ get
+ {
+ Win32.MEMORYSTATUSEX memStat = new Win32.MEMORYSTATUSEX { dwLength = 64 };
+ Win32.GlobalMemoryStatusEx(ref memStat);
+
+ ulong value = memStat.ullTotalPhys / 1024 / 1024;
+ return value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the number of CPU Cores
+ /// </summary>
+ /// <returns>Object</returns>
+ public static object GetCpuCount
+ {
+ get
+ {
+ RegistryKey regKey = Registry.LocalMachine;
+ regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
+ return regKey == null ? 0 : regKey.GetValue("ProcessorNameString");
+ }
+ }
+
+ /// <summary>
+ /// Gets the System screen size information.
+ /// </summary>
+ /// <returns>System.Windows.Forms.Scree</returns>
+ public static Screen ScreenBounds
+ {
+ get { return Screen.PrimaryScreen; }
+ }
+ }
+} \ No newline at end of file