蓝牙设备读取不成功,谁知道是怎么回事啊!

xayzmb 2016-01-19 04:30:54
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using InTheHand.Net;
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;

namespace testBLE_Cshap
{
//已引用了 InTheHand.Net.Personal
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
BluetoothRadio radio = BluetoothRadio.PrimaryRadio;
//if (radio == null)
//{
// MessageBox.Show("no");
// return;
//}
radio.Mode = RadioMode.Discoverable;
//运行到这里提示: {"未将对象引用设置到对象的实例。"}
}
}
}
...全文
845 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
xayzmb 2016-01-25
  • 打赏
  • 举报
回复
靠 原来是驱动问题 卸载了蓝牙驱动 改用windows自的蓝牙驱动 问题解决!!!
xayzmb 2016-01-20
  • 打赏
  • 举报
回复
竟然么有人,顶一下!
zixingcheng_ 2016-01-20
  • 打赏
  • 举报
回复
32feet的那个dll问题?哪里来的?最好源码调试看看。 调用Init方法时报错。也有可能radio还有啥方法或属性没设置或调用进行初始。最好看下dll的帮助说明
xayzmb 2016-01-20
  • 打赏
  • 举报
回复
没有人知道吗? 再顶一下哈
xayzmb 2016-01-20
  • 打赏
  • 举报
回复
我觉得关键问题在这里

[/quote]

就是不知道怎么解决
zixingcheng_ 2016-01-20
  • 打赏
  • 举报
回复
没弄过蓝牙,就代码看BluetoothRadio radio = BluetoothRadio.PrimaryRadio; 这个好像没示例呀,查看radio 有对象么?
xayzmb 2016-01-20
  • 打赏
  • 举报
回复
资源管理器里查 有的
xayzmb 2016-01-19
  • 打赏
  • 举报
回复
运行图上的exe文件
也报错

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧