title: C# Read Windows Mobile Broadband connection properties
body: <p>First up, here's the background:</p>
  
  <p>We have a Windows Forms application (written in C#, .NET Framework 3.5) currently running on full Windows 7 tablets, which have a 3G module built in that is used for data connectivity. The data connection is configured as a normal mobile broadband connection in Windows (so Windows manages the connectivity itself), and the connection shows up in Control Panel > Network and Internet > Network Connections and it works fine - the application is able to communicate over the internet with our web service. We will be moving onto a different device (likely a full Windows 8-based tablet) at some point in the future.</p>
  
  <p>Now, what I need to do is read the connection status of this Mobile Broadband connection; i.e. get the signal strength, and the carrier name (e.g. Vodafone UK). I've found a way to do this using the Mobile Broadband API part of the Windows 7 SDK (see <a href="http://msdn.microsoft.com/en-us/library/dd323271%28v=vs.85%29.aspx">here</a> and <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg487392.aspx">here</a>), however this appears to be OS specific as it doesn't work on Windows 8 - or at least not with the device I have here.</p>
  
  <p>Is there a generic way to read the mobile broadband connection properties using the .NET framework?</p>
  
  <p>Alternatively, does anyone know of a Windows 8 SDK which contains a Mobile Broadband API like the Windows 7 one I'm currently using?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Update - I've got this working on a range of different Win 7 / Win 8 devices now. Even the Lenovo device is working OK. I'll post up example code for the main bits (Reading connection status, configuring the connection, checking the SIM status) as answers; the code is a little too long to go into the question, annoyingly.</p>