コード例 #1
0
        public static string GetDeviceDescription(string device)
        {
            var deviceKey  = RegistryAccess.GetDeviceKey(device);
            var deviceDesc = deviceKey.GetValue("DeviceDesc").ToString();

            deviceDesc = deviceDesc.Substring(deviceDesc.IndexOf(';') + 1);

            //var deviceClass = RegistryAccess.GetClassType(deviceKey.GetValue("ClassGUID").ToString());
            //isKeyboard = deviceClass.ToUpper().Equals( "KEYBOARD" );

            return(deviceDesc);
        }
コード例 #2
0
ファイル: Win32.cs プロジェクト: stevemesser/rawinput
        public static string GetDeviceDescription(string device)
        {
            string deviceDesc;

            try
            {
                var deviceKey = RegistryAccess.GetDeviceKey(device);
                deviceDesc = deviceKey.GetValue("DeviceDesc").ToString();
                deviceDesc = deviceDesc.Substring(deviceDesc.IndexOf(';') + 1);
            }
            catch (Exception)
            {
                deviceDesc = "Device is malformed unable to look up in the registry";
            }

            //var deviceClass = RegistryAccess.GetClassType(deviceKey.GetValue("ClassGUID").ToString());
            //isKeyboard = deviceClass.ToUpper().Equals( "KEYBOARD" );

            return(deviceDesc);
        }