.NET Components for Mobility

Peter Foot

Microsoft Windows Phone Development MVP

Internet Connection Sharing with Mobile In The Hand 4.0

In Mobile In The Hand 4.0 all the Windows Mobile networking features are found in the InTheHand.WindowsMobile.Net assembly. This contains support for Connection Manager, Internet Sharing and Wireless Manager. This post will look at the Internet Sharing classes. Internet Sharing was introduced in Windows Mobile 5.0 AKU 3 but is generally associated with Windows Mobile 6. You can share an internet connection over a USB connection or over Bluetooth using the PAN (Personal Area Network) profile. To enable or disable a sharing session from your code you need only call a single method which looks like this:-

InTheHand.WindowsMobile.Net.InternetSharing.Enable(InTheHand.WindowsMobile.Net.SharingConnection.Bluetooth,"O2")

The first argument is a member of the SharingConnection enumeration which contains values for Bluetooth and Usb. The second argument is the name of the internet connection to use - this is the name of the GPRS connection which will be dialled. A simple Disable method exists to shut down the sharing connection:-

InTheHand.WindowsMobile.Net.InternetSharing.Disable()

You must remember to disable the connection once you have finished using it.

A full online library of class documentation for all this and more is available. For more information about Mobile In The Hand see the product page.

Comments

No Comments

About PeterFoot

Peter Foot is co-author of the Microsoft Mobile Development Handbook published by Microsoft Press. Peter has been awarded the Microsoft Most Valuable Professional (MVP) accolade since 2003 for his involvement in the Microsoft .NET Compact Framework developer community. Alongside an active presence in several online forums and communities, attendance at developer conferences and involvement in shared-source projects, Peter has also written a number of technical articles and maintains an active technical blog.
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting