How to determine the mobile operator for Windows Phone 8.1

Previously  in WP8.0,To determine mobile operator we are using DeviceNetworkInformation.CellularMobileOperator.
WP8.0:
  1. string MobileOperatorName = DeviceNetworkInformation.CellularMobileOperator;  
 WP8.1:
  1. public void GetMobileOperatorName()  
  2.         {  
  3.             var result = NetworkInformation.GetConnectionProfiles();  
  4.             string CarrierName = "";  
  5.             foreach (var connectionProfile in result)  
  6.             {  
  7.                 if (connectionProfile.IsWwanConnectionProfile)  
  8.                 {  
  9.                     foreach (var networkName in connectionProfile.GetNetworkNames())  
  10.                     {  
  11.                         CarrierName = networkName;//Get mobile operator Name  
  12.                         break;  
  13.                     }  
  14.                 }  
  15.             }  
  16.         }  
Note: You must enabled your data connection.  
 
Read more useful tips from http://bsubramanyamraju.blogspot.in/2014/07/windowsphone-tipstop-basics-for.html