Most of the app developers require a way to uniquely identify each mobile device. Given below is a simple function which will give you the device id in the string format.
public string GetDeviceId()
{
byte[] myDeviceID=(byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
return Convert.ToBase64String(myDeviceID);
}