bạn có thể sử dụng một chức năng như thế này: -
public static string getDeviceInfo(bool asList = false)
{
string r = "";
Geolocator locationservice = new Geolocator();
if (DeviceNetworkInformation.CellularMobileOperator != "") r += "CellularMobileOperator: " + DeviceNetworkInformation.CellularMobileOperator + Environment.NewLine;
r += "CellularDataEnabled: " + DeviceNetworkInformation.IsCellularDataEnabled + Environment.NewLine;
r += "WiFiEnabled: " + DeviceNetworkInformation.IsWiFiEnabled + Environment.NewLine;
r += "IsNetworkAvailable: " + DeviceNetworkInformation.IsNetworkAvailable + Environment.NewLine;
r += "Hardware Identifier: " + Convert.ToBase64String((byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId")) + Environment.NewLine;
r += "Location Services Permission: " + locationservice.LocationStatus + Environment.NewLine;
r += "Language: " + CultureInfo.CurrentCulture.EnglishName + Environment.NewLine;
r += "Locale: " + CultureInfo.CurrentCulture.Name + Environment.NewLine;
//r += "Background Service Enabled: " + ScheduledActionService.Find("PeriodicAgent").IsEnabled + Environment.NewLine;
r += "Runtime Version: " + Environment.Version + Environment.NewLine;
r += "Maximum Memory: " + (DeviceStatus.DeviceTotalMemory/(1024 * 1024)) + "M" + Environment.NewLine;
r += "Maximum Memory Available: " + (DeviceStatus.ApplicationMemoryUsageLimit/(1024 * 1024)) + "M" + Environment.NewLine;
r += "Peak Memory Use: " + (DeviceStatus.ApplicationPeakMemoryUsage/(1024 * 1024)) + "M" + Environment.NewLine;
r += "Charger: " + DeviceStatus.PowerSource + Environment.NewLine;
r += "DeviceFirmwareVersion: " + DeviceStatus.DeviceFirmwareVersion + Environment.NewLine;
r += "DeviceManufacturer: " + DeviceStatus.DeviceManufacturer + Environment.NewLine;
r += "OS Version: " + Environment.OSVersion + Environment.NewLine;
r += "User ID: " + settings[KeyString.USER_ID] + Environment.NewLine;
var phone = PhoneNameResolver.Resolve(DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);
r += "Phone model(userfriendly form):" +phone.FullCanonicalName ;
return r;
}
Nguồn
2014-04-14 10:03:43
On mà điện thoại được bạn kiểm tra mã của bạn và bạn nhận được giá trị nào từ các cuộc gọi đến 'DeviceStatus.DeviceName' hoặc' DeviceStatus.DeviceManufacturer'? – Haspemulator
tôi đã được thử nghiệm trên Lumia 520 và DeviceStatus.DeviceName cho giá trị như RM-914_im_india_389 này và DeviceStatus.DeviceManufacturer cho giá trị của Nokia, nhưng tôi giải quyết này bằng cách sử dụng [PhoneNameResolver] (https://github.com/ailon/PhoneNameResolver) theo đề nghị của [Olivier Payen] (http://stackoverflow.com/questions/17425016/information-about-windows-phone-model-number?answertab=votes#tab-top) – Jatin