【问题标题】:Bluetooth programming in C#, connection between mobile device and laptopC#中的蓝牙编程,移动设备和笔记本电脑之间的连接
【发布时间】:2010-12-13 14:53:49
【问题描述】:

我正在笔记本电脑上使用 C#.Net、Windows 窗体编写程序。 我想通过蓝牙连接我的笔记本电脑和手机(不是 Windows 手机,而是任何手机)。

我已经在很多网站上(例如 32feet.NET),但是有很多文件,我迷路了。 我只需要一个简单的程序,它将数据(整数、字符串...)发送到手机,反之亦然。

我从哪里开始?谢谢你的帮助:)

【问题讨论】:

  • 您找到解决方案了吗?
  • 多年没用 C# 编程了,我不记得当时了,抱歉。

标签: c# winforms mobile bluetooth


【解决方案1】:

查看这篇文章My Second Attempt at Blogging - Bluetooth Programming with C# 解释了如何通过简单的步骤使用 32feet.NET。

在用于向蓝牙设备发送文件的示例 sn-p 下方(取自同一篇文章)。

string filename = System.IO.Path.GetFileName(openFileDialog1.FileName);
Uri u = new Uri("obex-push://" + devAddr.ToString() + "/" + filename);
ObexWebRequest owr = new ObexWebRequest(u);
owr.ReadFile(openFileDialog1.FileName);
ObexWebResponse response = (ObexWebResponse)owr.GetResponse();
response.Close();

【讨论】:

  • 你的 devAddr 是什么?这是我要查找的文件的完整地址吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-30
  • 1970-01-01
  • 2016-05-06
相关资源
最近更新 更多