NetworkOperatorTetheringManager.CreateFromConnectionProfile Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateFromConnectionProfile(ConnectionProfile) |
Creates a NetworkOperatorTetheringManager using the given profile as the public interface and Wi-Fi as the private interface. |
CreateFromConnectionProfile(ConnectionProfile, NetworkAdapter) |
Creates a NetworkOperatorTetheringManager using the given profile as the public interface, and on the given NetworkAdapter as the private interface. |
CreateFromConnectionProfile(ConnectionProfile)
Creates a NetworkOperatorTetheringManager using the given profile as the public interface and Wi-Fi as the private interface.
public:
static NetworkOperatorTetheringManager ^ CreateFromConnectionProfile(ConnectionProfile ^ profile);
static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile const& profile);
/// [Windows.Foundation.Metadata.Overload("CreateFromConnectionProfile")]
static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile const& profile);
public static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile profile);
[Windows.Foundation.Metadata.Overload("CreateFromConnectionProfile")]
public static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile profile);
function createFromConnectionProfile(profile)
Public Shared Function CreateFromConnectionProfile (profile As ConnectionProfile) As NetworkOperatorTetheringManager
Parameters
- profile
- ConnectionProfile
Connection profile to be used.
Returns
The resulting manager object.
- Attributes
Windows requirements
App capabilities |
wiFiControl
|
Remarks
In previous releases, only privileged apps from network operators could create a NetworkOperatorTetheringManager object and use it to control tethering. In this release, any app can create the object by calling CreateFromConnectionProfile. In order for the call to succeed, however, the app must have the appropriate Wi-Fi control device capability declared in its manifest. The following example shows part of a manifest with the necessary DeviceCapability tag, with the wiFiControl attribute.
<Capabilities>
<DeviceCapability Name="wiFiControl"/>
</Capabilities>
If the wiFiControl device capability is not set in the manifest, then calls to CreateFromConnectionProfile fail by throwing an exception.
Your code can determine whether the capability is set at runtime by calling GetTetheringCapabilityFromConnectionProfile. If DisabledBySystemCapability is returned, then the manifest does not set the required device capability. Note that even if Enabled is returned, your code should be written to handle errors and exceptions, since tethering capability can change at any time, outside your app's control or notice.
See also
Applies to
CreateFromConnectionProfile(ConnectionProfile, NetworkAdapter)
Creates a NetworkOperatorTetheringManager using the given profile as the public interface, and on the given NetworkAdapter as the private interface.
public:
static NetworkOperatorTetheringManager ^ CreateFromConnectionProfile(ConnectionProfile ^ profile, NetworkAdapter ^ adapter);
/// [Windows.Foundation.Metadata.Overload("CreateFromConnectionProfileWithTargetAdapter")]
static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile const& profile, NetworkAdapter const& adapter);
[Windows.Foundation.Metadata.Overload("CreateFromConnectionProfileWithTargetAdapter")]
public static NetworkOperatorTetheringManager CreateFromConnectionProfile(ConnectionProfile profile, NetworkAdapter adapter);
function createFromConnectionProfile(profile, adapter)
Public Shared Function CreateFromConnectionProfile (profile As ConnectionProfile, adapter As NetworkAdapter) As NetworkOperatorTetheringManager
Parameters
- profile
- ConnectionProfile
Connection profile to be used.
- adapter
- NetworkAdapter
The network adapter where the connection is shared. The shared connection will be controlled by the NetworkOperatorTetheringManager.
Returns
The resulting manager object.
- Attributes
Windows requirements
Device family |
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v3.0)
|
App capabilities |
wiFiControl
|
Remarks
In previous releases, only privileged apps from network operators could create a NetworkOperatorTetheringManager object and use it to control tethering. In this release, any app can create the object by calling CreateFromConnectionProfile. In order for the call to succeed, however, the app must have the appropriate Wi-Fi control device capability declared in its manifest. The following example shows part of a manifest with the necessary DeviceCapability tag, with the wiFiControl attribute.
<Capabilities>
<DeviceCapability Name="wiFiControl"/>
</Capabilities>
If the wiFiControl device capability is not set in the manifest, then calls to CreateFromConnectionProfile fail by throwing an exception.
Your code can determine whether the capability is set at runtime by calling GetTetheringCapabilityFromConnectionProfile. If DisabledBySystemCapability is returned, then the manifest does not set the required device capability. Note that even if Enabled is returned, your code should be written to handle errors and exceptions, since tethering capability can change at any time, outside your app's control or notice.