private static bool Connect(IntPtr clientHandle, Guid interfaceGuid, string profileName, DOT11_BSS_TYPE bssType) { var connectionParameters = new WLAN_CONNECTION_PARAMETERS { wlanConnectionMode = WLAN_CONNECTION_MODE.wlan_connection_mode_profile, strProfile = profileName, dot11BssType = bssType, dwFlags = 0U }; var result = WlanConnect( clientHandle, interfaceGuid, ref connectionParameters, IntPtr.Zero); // ERROR_NOT_FOUND will be returned if the interface is removed. return CheckResult(result, "WlanConnect", false); }
public static extern uint WlanConnect( SafeClientHandle hClientHandle, [MarshalAs(UnmanagedType.LPStruct), In] Guid pInterfaceGuid, [In] ref WLAN_CONNECTION_PARAMETERS pConnectionParameters, IntPtr pReserved);