有没有办法从 Windows 10 中的 c# 桌面应用程序使用蓝牙 LE? [英] Is there any way to use Bluetooth LE from a c# desktop app in windows 10?

查看:27
本文介绍了有没有办法从 Windows 10 中的 c# 桌面应用程序使用蓝牙 LE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上找到的所有关于蓝牙 LE 的东西都需要一个通用的 windows 应用程序,这完全不适合我.

Everything I found online regarding bluetooth LE requires a universal windows app, which is completely unsuitable for me.

有没有办法在 C# 中使用蓝牙 LE,而不必像在 UWP 上那样编写整个应用程序?

Is there a way to use bluetooth LE from c# without having to write my whole app as on UWP?

推荐答案

您可以在 C# 桌面应用程序中使用 C# API!我有一个 GitHub 中的示例.

You can use C# APIs in C# Desktop applications! I have a sample here in GitHub.

一般来说,要访问 C# APIS,请向您的项目添加两个引用:

In general, to get access to the C# APIS, add two references to your project:

  1. C:Program Files (x86)Windows Kits10UnionMetadataWindows.winmd
  2. C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETCorev4.5System.Runtime.WindowsRuntime.dll

请注意,#2 版本取决于您使用的 .NET 版本.

Note that the #2 version depends on the version of .NET that you're using.

不支持后台任务,但所有其他蓝牙 C#功能应该在那里.

Background tasks will not be supported, but all other Bluetooth C# features should be there.

这篇关于有没有办法从 Windows 10 中的 c# 桌面应用程序使用蓝牙 LE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆