Windows / .Net中的蓝牙API?

我正在编写一个蓝牙扫描器,在当地附近定位和识别移动设备。 这是我可以使用C#完成的事情,还是我需要下载到C / C ++ API? 我的应用程序是针对Windows XP和Vista。 指针表示赞赏。

谢谢!

PC上蓝牙的一个问题是,有几个BT堆栈正在使用,你永远不知道在给定的机器上可以使用哪一个。 最常见的是Widcomm(现在的Broadcom)和微软(出现在XP中,也许是其中的一个服务包)。 不过,一些BT硬件厂商BlueSoleil和一些使用Toshiba的厂商。 大多数加密狗将与MS堆栈工作,所以我见过的.NET库倾向于使用它。

每个堆栈都有一个完全不同的方式来做发现的一部分,你浏览附近的设备和查询他们的服务。

如果今天我必须选择一种方法,我可能会在C ++中进行发现,并为.NET添加一个接口。

32feet.net的东西工作得很好,当我尝试它,但不支持Widcomm堆栈。

还有Peter Foot的32feet.net

http://inthehand.com/content/32feet.aspx

当它是v1.5时,我已经玩了这个回来,它运作良好。

迈克Petrichenko有一个很好的BT框架。 它适用于BlueSoleil,Widcomm,东芝和微软。

它现在被称为无线通信库,并与蓝牙802.11和红外协同工作。 Mike将公司命名为Soft Service Company,并以100美元至2050美元的价格出售非商业和商业许可证,无论是否有源代码。

我能找到的唯一受管理的BlueTooth API在这里 。

知道蓝牙设备和从PC发送文件到蓝牙设备的最佳方式是使用该代码。

public void ExecuteCommandSync(object command) { try { // create the ProcessStartInfo using "cmd" as the program to be run, // and "/c " as the parameters. // Incidentally, /c tells cmd that we want it to execute the command that follows, // and then exit. System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command); // The following commands are needed to redirect the standard output. // This means that it will be redirected to the Process.StandardOutput StreamReader. procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; // Do not create the black window. procStartInfo.CreateNoWindow = true; // Now we create a process, assign its ProcessStartInfo and start it System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo = procStartInfo; proc.Start(); // Get the output into a string string result = proc.StandardOutput.ReadToEnd(); // Display the command output. Console.WriteLine(result); } catch (Exception objException) { // Log the exception MessageBox.Show(objException.Message); } } 

你可以调用这个方法

  string command = "fsquirt"; ExecuteCommandSync(command); 

因此,BluetoothFileTransferWizard出现,您可以选择可用的设备,并发送文件发送该设备。 如果你不想使用这种方式,请尝试32feet.net.uk。 这对C#和VB.NET的蓝牙开发非常有用。