private void FillCoreInfo()
		{
			RegistryKey regKey = Registry.LocalMachine;
			regKey = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
			cpuSpeed = (int)regKey.GetValue("~MHz");
			cpuName = (string)regKey.GetValue("ProcessorNameString");
			var display = new WindowsDisplayDevice();
			display.cb = Marshal.SizeOf(display);
			uint deviceNum = 0;
			var gpuNames = new List<string>();
			while (EnumDisplayDevices(null, deviceNum++, display, 0))
				if (IsRelevantDevice(display, gpuNames))
					gpuNames.Add(display.deviceString);
			gpuName = string.Join(",", gpuNames);
		}
Пример #2
0
        private void FillCoreInfo()
        {
            RegistryKey regKey = Registry.LocalMachine;

            regKey   = regKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
            cpuSpeed = (int)regKey.GetValue("~MHz");
            cpuName  = (string)regKey.GetValue("ProcessorNameString");
            var display = new WindowsDisplayDevice();

            display.cb = Marshal.SizeOf(display);
            uint deviceNum = 0;
            var  gpuNames  = new List <string>();

            while (EnumDisplayDevices(null, deviceNum++, display, 0))
            {
                if (IsRelevantDevice(display, gpuNames))
                {
                    gpuNames.Add(display.deviceString);
                }
            }
            gpuName = string.Join(",", gpuNames);
        }
Пример #3
0
 private static extern bool EnumDisplayDevices(
     [MarshalAs(UnmanagedType.LPTStr)] string lpDevice, uint iDevNum,
     [In, Out] WindowsDisplayDevice lpDisplayDevice, uint dwFlags);
Пример #4
0
 private static bool IsRelevantDevice(WindowsDisplayDevice display, List <string> gpuNames)
 {
     return(gpuNames.Contains(display.deviceString) == false &&
            display.deviceString.Trim().Length > 0 && display.deviceString.Contains("RDP") == false);
 }
		private static bool IsRelevantDevice(WindowsDisplayDevice display, List<string> gpuNames)
		{
			return gpuNames.Contains(display.deviceString) == false &&
				display.deviceString.Trim().Length > 0 && display.deviceString.Contains("RDP") == false;
		}