简体   繁体   中英

Initializing Mobile Hotspot using bluetooth C#

I need to create a service that starts a mobile hotspot using bluetooth. I've found the code to create a hotspot service, but this creates a hotspot with the Ethernet adapter.

I've read the documentation and can't find anything to specify bluetooth like in the settings UI.

Windows设置移动热点用户界面

This is the code to initialize the hotspot with the Ethernet adapter.

var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
var tetheringManager = Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager.CreateFromConnectionProfile(connectionProfile);

The problem with this is that the network is shared through WiFi, and not Bluetooth.

Here are my current connections: 当前连接

My OS were unfortiunately installed in Norwegian, but the display should look familiar in English.

GetConnectionProfiles returns a IReadOnlyList of ConnectionProfile . You can then try to select a specific profile from the list to operate on, instead of using the default one you have in your snippet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM