简体   繁体   English

使用蓝牙C#初始化移动热点

[英]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. 我已经阅读了文档,找不到任何可以在设置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. 问题是网络是通过WiFi共享的,而不是通过蓝牙共享的。

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 . GetConnectionProfiles返回ConnectionProfileIReadOnlyList 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. 然后,您可以尝试从列表中选择一个特定的配置文件进行操作,而不是使用代码段中的默认配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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