textBlockGetManufacture.Text = DeviceExtendedProperties.GetValue ("DeviceManufacturer"). ToString ();
textBlockGetManufacture.Text = Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer;
public MainPage() { InitializeComponent(); timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 10); timer.Tick += new EventHandler(timer_Tick); } DispatcherTimer timer; private void butGetInfo_Click(object sender, RoutedEventArgs e) { // // // textBlockGetManufacture.Text = DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString(); // Windows Phone 7.1 Mango textBlockGetManufacture.Text = Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer; // // // textBlockGetName.Text = DeviceExtendedProperties.GetValue("DeviceName").ToString(); // Windows Phone 7.1 Mango textBlockGetName.Text = Microsoft.Phone.Info.DeviceStatus.DeviceName; // byte[] id = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId"); textBlockGetID.Text = BitConverter.ToString(id); // // // textBlockGetFirmware.Text = DeviceExtendedProperties.GetValue("DeviceFirmwareVersion").ToString(); // Windows Phone 7.1 Mango textBlockGetFirmware.Text = Microsoft.Phone.Info.DeviceStatus.DeviceFirmwareVersion; // // // textBlockGetHardware.Text = DeviceExtendedProperties.GetValue("DeviceHardwareVersion").ToString(); // Windows Phone 7.1 Mango textBlockGetHardware.Text = Microsoft.Phone.Info.DeviceStatus.DeviceHardwareVersion; // // //var maxmem = (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory"); // maxmem /= 1024 * 1024; //textBlockGetTotalMemory.Text = maxmem.ToString(); // Windows 7.1. Mango var totalmem = Microsoft.Phone.Info.DeviceStatus.DeviceTotalMemory; totalmem /= 1024 * 1024; textBlockGetTotalMemory.Text = totalmem.ToString(); // Windows 7.1 Mango // textBlockGetKeyboardDeploy.Text = Microsoft.Phone.Info.DeviceStatus.IsKeyboardDeployed.ToString(); // textBlockGetPresentKeyboard.Text = Microsoft.Phone.Info.DeviceStatus.IsKeyboardPresent.ToString(); // textBlockGetPowerSource.Text = Microsoft.Phone.Info.DeviceStatus.PowerSource.ToString(); } private void buttonMemory_Click(object sender, RoutedEventArgs e) { timer.Start(); } void timer_Tick(object sender, EventArgs e) { try { // // textBlockGetCurrentMemory.Text = DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage").ToString(); // textBlockGetPeakMemory.Text = DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage").ToString(); // Windows 7.1. Mango textBlockGetCurrentMemory.Text = Microsoft.Phone.Info.DeviceStatus.ApplicationCurrentMemoryUsage.ToString(); textBlockGetPeakMemory.Text = Microsoft.Phone.Info.DeviceStatus.ApplicationPeakMemoryUsage.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
Source: https://habr.com/ru/post/120154/
All Articles