bool Connect(string, string, string)
Connects to the network with the specified SSID (network name) on the specified interface with the specified key.
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
ssid |
string The ssid of the wireless network to connect to. This must match one of the items returned by Scan(), and is case-sensitive. |
interfaceGUID |
string The GUID of the interface to perform the connection on. This must match the GUID of one of the items returned by GetInterfaces(). |
key |
(Optional) string The key for the the wireless network to connect to. Key is optional if the profile already exists. |
Return
True if the connection was successfully requested, false otherwise.
Remarks
Attempts to connect using a saved profile, otherwise a new profile is created if none exists. This function is asynchronous, and will fire the OnConnectionRequestCompleted callback when the request has been completed.
Examples
// attempts a connection to ssid mywifi on the first interface.
var interfaces = KioWiFi.GetInterfaces();
if (interfaces.length == 0) {
alert('No network interfaces were detected');
return;
}
var networks = KioWiFi.Connect('mywifi', interfaces[0].guid, 'password');
function OnConnectionRequestCompleted(connChangedResult) {
if (!connChangedResult.result)
alert('Failed to connect');
else
alert('Connected to ' + connChangedResult.ssid + ' on ' + connChangedResult.iface.interfaceName);
}
Requirements
KioWare for Windows version 8.14 or greater.