WLanconnect XML wlan_connection_mode_temporary_profile lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- pcurtis · 2021-11-11 12:20 I use this to connect to a wifi AP and it works. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses…, nduWlanAPI, Windows, nduWlanTypes, …procedure TForm1.Button1Click(Sender: TObject);varhClient: THandle;dwVersion: DWORD;ResultInt: DWORD;pInterface: Pndu_WLAN_INTERFACE_INFO_LIST;pConnectionParameters : tndu_WLAN_CONNECTION_PARAMETERS;Tvar : tndu_WLAN_CONNECTION_PARAMETERS;PConnectionParameters1 : pndu_WLAN_CONNECTION_PARAMETERS;pAvailableNetworkList: Pndu_WLAN_AVAILABLE_NETWORK_LIST;pInterfaceGuid: PGUID;beginResultInt := WlanOpenHandle(1, nil, @dwVersion, @hClient);ResultInt := WlanEnumInterfaces(hClient, nil, @pInterface);pInterfaceGuid := @pInterface^.InterfaceInfo[pInterface^.dwIndex].InterfaceGuid; pConnectionParameters.wlanConnectionMode := WLAN_CONNECTION_MODE_PROFILE;     pConnectionParameters.strProfile := 'MySSID';pConnectionParameters.pDot11Ssid := nil;pConnectionParameters.pDesiredBssidList := nil;pConnectionParameters.dot11BssType := dot11_BSS_type_any;pConnectionParameters.dwFlags := 0;ResultInt := WlanConnect(hClient,                         pInterfaceGuid,                       @pConnectionParameters,                         nil); end;  If I export the to a XML file, using netsh wlan export profile name=MySSID, and change the connection mode to wlan_connection_mode_temporary_profile, how do I pass the XML to the WLanconnect function? ---------------------------------------------------------------------- Ulrich Wiesemann · 2021-12-22 16:11 Hello pcurtis, I am unable to output the information from the pointers "pAvailableNetworkList" or "pConnectionParameters" in a memo. Can you write an example source code? Gruß Ulrich ---------------------------------------------------------------------- pcurtis · 2021-12-22 17:59 Hi there,i not quite sure what you need, anyway the only source I have is attached above. ---------------------------------------------------------------------- Warfley · 2021-12-22 20:00 According to the documentation, this has to be done with the strProfile field of the WLAN_CONNECTION_PARAMETERS structure: QuoteSpecifies the profile being used for the connection. If wlanConnectionMode is set to wlan_connection_mode_profile, then strProfile specifies the name of the profile used for the connection. If wlanConnectionMode is set to wlan_connection_mode_temporary_profile, then strProfile specifies the XML representation of the profile used for the connection. If wlanConnectionMode is set to wlan_connection_mode_discovery_secure or wlan_connection_mode_discovery_unsecure, then strProfile should be set to NULL. ---------------------------------------------------------------------- pcurtis · 2021-12-23 05:16 Yes, I've read that, but how? ---------------------------------------------------------------------- Warfley · 2021-12-23 22:12 Well what did you try? I read that as if it should contain the XML content as string. Alternatively maybe pass the path to the XML file. ---------------------------------------------------------------------- pcurtis · 2021-12-25 08:07 @warfley See attached project ---------------------------------------------------------------------- Ulrich Wiesemann · 2021-12-26 17:10 Many thanks for the quick response. As I spend the holidays with my family, I won't have time again until later!