How to get the DeviceName and the ManufacturerName of the Windows Phone device using C# ?

In one of my earlier posts , i talked about How to get the UniqueID of the Windows Phone device using C# ?, the Developers can also use the same class “DeviceExtendedProperties” defined in the assembly Microsoft.Phone.Info  to retreive the DeviceName and the ManufacturerName too .

Below is a sample code that lets you retreive the DeviceName and the ManufacturerName which again uses the extended device property lists “DeviceManufacturer” and “DeviceName” .

private void button1_Click(object sender, RoutedEventArgs e)
{
     string modelname = null;
     object modelobject = null;
     if (Microsoft.Phone.Info.DeviceExtendedProperties.TryGetValue("DeviceName", out modelobject))
      modelname = modelobject as string;
     string ManufacturerName="";
     object manufacturerobject;
     if (DeviceExtendedProperties.TryGetValue("DeviceManufacturer", out manufacturerobject))
      ManufacturerName = manufacturerobject.ToString();
     MessageBox.Show("Device Name = " + modelname + " Manufacturer = " + ManufacturerName );
}

When the above example is run on emulator , the DeviceName will be XDeviceEmulator and the Manufacturer will be Microsoft .

Reference : Device Information for Windows Phone

 

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


x

Interesting BlogPosts to read

U.S. FDA Accepts Biologics License Application (BLA) for Mylan and Biocon’s Proposed Biosimilar Pegfilgrastim for Review
Mylan N.V. (NASDAQ, TASE: MYL) and Biocon Ltd. (BSE code: 532523, NSE: BIOCON) today announced that ...
eGovernments Foundation Signed MoU with Kozhikode Municipal Corporation for Implementing Building Plan Automation Software in Kozhikode
Bengaluru based eGovernments Foundation has signed an agreement with Kozhikode Municipal Corporation...
Swanbay and FaZe Clan Join Hands to Promote the World's Largest Professional Gaming Team in India
The world’s largest professional gaming team, FaZe Clan, has now partnered with Swanbay; a mobile pl...