1. start visual studio 2010
2. create a new console application.
3. add reference to “Microsoft.Smartdevice.Connectivity” which is found in the path
“c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SmartDevice.Connectivity\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.Smartdevice.Connectivity.dll”
// ----- Select this path according to your system.
Note : Please keep in mind for this sample to work you should have windows phone sdk installed on your pc.
Paste this code in Program.cs which is created by default in your project.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SmartDevice.Connectivity;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SmartDevice.Connectivity;
using System.Globalization;