Modified library from http://managedwifi.codeplex.com/