/* System.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ namespace Handbrake.Functions { using System.Windows.Forms; using Microsoft.Win32; /// /// The System Information. /// public class SystemInfo { /// /// Gets the total physical ram in a system /// /// The total memory in the system public static uint TotalPhysicalMemory { get { Win32.MEMORYSTATUS memStatus = new Win32.MEMORYSTATUS(); Win32.GlobalMemoryStatus(ref memStatus); uint memoryInfo = memStatus.dwTotalPhys; memoryInfo = memoryInfo / 1024 / 1024; return memoryInfo; } } /// /// Gets the number of CPU Cores /// /// Object public static object GetCpuCount { get { RegistryKey regKey = Registry.LocalMachine; regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"); return regKey == null ? 0 : regKey.GetValue("ProcessorNameString"); } } /// /// Gets the System screen size information. /// /// System.Windows.Forms.Scree public static Screen ScreenBounds { get { return Screen.PrimaryScreen; } } } }