You can do this as an example of the code @Jason is associated with. But right now there are no bindings for CaptiveNetwork in current versions of MonoTouch (but it will be included in a future beta).
In the meantime, you can copy-paste the following code inside your application to get the SSID.
using System; using System.Runtime.InteropServices; using MonoTouch; using MonoTouch.CoreFoundation; using MonoTouch.Foundation; using MonoTouch.ObjCRuntime; [DllImport (Constants.SystemConfigurationLibrary)] extern static IntPtr CNCopyCurrentNetworkInfo (IntPtr interfaceName); static string GetSSID () { IntPtr scl = Dlfcn.dlopen (Constants.SystemConfigurationLibrary, 0); try { using (NSString en0 = new NSString ("en0")) { using (NSDictionary dict = new NSDictionary (CNCopyCurrentNetworkInfo (en0.Handle))) { using (NSString key = Dlfcn.GetStringConstant (scl, "kCNNetworkInfoKeySSID")) { return dict [key].ToString (); } } } } catch (EntryPointNotFoundException) {
UPDATE . The most recent versions of MonoTouch 5.2+ include support for CaptiveNetwork . The above code is simplified:
using MonoTouch.SystemConfiguration; static string GetSSID () { var dict = CaptiveNetwork.CopyCurrentNetworkInfo ("en0"); return dict [CaptiveNetwork.NetworkInfoKeySSID].ToString (); }
source share