c#我们的适配器的蓝牙Mac地址

时间:2014-05-02 14:54:36

标签: c# .net bluetooth 32feet

我正在使用IntheHand 32feet库http://32feet.codeplex.com/ 我正在寻找一个代码来获取蓝牙适配器的本地MAC地址。我试过可以快速调整但不能像

那样工作
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;

          BluetoothListener btListener;
btListener.Server.AddressFamily.ToString(); 

但不起作用。请建议我获取地址的方式

1 个答案:

答案 0 :(得分:3)

https://32feet.codeplex.com/wikipage?title=Local%20Radio%20Information

BluetoothRadio myRadio = BluetoothRadio.PrimaryRadio;
if (myRadio == null) {
    Console.WriteLine("No radio hardware or unsupported software stack");
    return;
}
RadioMode mode = myRadio.Mode;
// Warning: LocalAddress is null if the radio is powered-off.
Console.WriteLine("* Radio, address: {0:C}", myRadio.LocalAddress);