public override async Task<HardwareInfo> GetOSHardwareInfo()
        {
            var clientDeviceInformation = new EasClientDeviceInformation();

            var hardwareInfo = new HardwareInfo
            {
                Name = clientDeviceInformation.SystemProductName,
                Vendor = clientDeviceInformation.SystemManufacturer,
                Version = clientDeviceInformation.SystemHardwareVersion
            };

            var token = HardwareIdentification.GetPackageSpecificToken(null);
            var hardwareId = token.Id;
            var hasher = HashAlgorithmProvider.OpenAlgorithm("MD5");
            var hashed = hasher.HashData(hardwareId);
            hardwareInfo.UUID = CryptographicBuffer.EncodeToHexString(hashed);
            return hardwareInfo;
        }
Exemplo n.º 2
0
        /// <summary>
        ///  
        /// </summary>
        /// <returns>
        /// A <see cref="HardwareInfo"/>
        /// </returns>
        public override HardwareInfo GetOSHardwareInfo()
        {
            HardwareInfo hi = new HardwareInfo();

            UIDevice uiDevice = UIDevice.CurrentDevice;
            hi.Name = uiDevice.Name;
            hi.UUID = uiDevice.UniqueIdentifier;
            hi.Vendor = "Apple Inc.";
            hi.Version = DeviceHardware.Version.ToString();  // uiDevice.Model  (not enough info)

            return hi;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns current Hardware information.
        /// </summary>
        /// <returns>Hardware Information.</returns>
        public override HardwareInfo GetOSHardwareInfo()
        {
            HardwareInfo hi = new HardwareInfo();
            hi.Name = "Unknown";
            hi.UUID = "Unknown";
            hi.Version = "Unknown";
            hi.Vendor = "Unknown";

            string Key = "Win32_ComputerSystemProduct";
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from " + Key);
            foreach (ManagementObject share in searcher.Get())
            {
                foreach (PropertyData PC in share.Properties)
                {
                    if (PC.Name == "Name")
                    {
                        hi.Name = PC.Value.ToString();
                    }
                    if (PC.Name == "UUID")
                    {
                        hi.UUID = PC.Value.ToString();
                    }
                    if (PC.Name == "Vendor")
                    {
                        hi.Vendor = PC.Value.ToString();
                    }
                    if (PC.Name == "Version")
                    {
                        hi.Version = PC.Value.ToString();
                    }
                }
            }

            return hi;
        }