Fetching Mobile Operator Name in Windows 7.1 Phone [Mango]

In this quick post I will show you,

How to fetch Mobile operator name in Windows 7 Phone?

Design the page

In content Grid, I have put a button. On click event of button, in message box we will display Mobile Operator Name

image

Write Code Behind

Add Namespace

clip_image001

On the click event of Button we will fetch operator name. Operator name can be fetched

clip_image003

Using calling CellularMobileOperator() function on DeviceNetworkInformation. After fetching , you can use it as string.

For your reference source code is as below,

MainPage.Xaml.cs


using System.Windows;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Net.NetworkInformation;

namespace MobileOperatorName
{
    public partial class MainPage : PhoneApplicationPage
    {

        public MainPage()
        {
            InitializeComponent();
            btnMobileOpeartor.Click += new RoutedEventHandler(btnMobileOpeartor_Click);
        }

        void btnMobileOpeartor_Click(object sender, RoutedEventArgs e)
        {
            string operatorName = "Mobile Opeartor : ";
            operatorName = operatorName + DeviceNetworkInformation.CellularMobileOperator.ToString();
            MessageBox.Show(operatorName);
        }

    }
}

Running the Application

Press F5 to run the application.

imageimage

I hope this post was useful. Thanks for reading Smile

2 responses to “Fetching Mobile Operator Name in Windows 7.1 Phone [Mango]”

  1. […] Fetching Mobile Operator Name in Windows 7.1 Phone [Mango] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com