Get DDL to
click here
You can use it from C# like this:
[DllImport("bLADEBluetoothLib.dll",
EntryPoint = "discoverbluetoothdevices",
CharSet = CharSet.Unicode,
SetLastError = true)]
private static extern int DiscoverBluetoothDevices(String deviceList);
[DllImport("Ws2.dll",
SetLastError = true)]
private extern static Int32 WSAGetLastError();
public static string[] GetDiscoverableDevices()
{
String deviceList = new String(' ', 500);
int nbrDevices = DiscoverBluetoothDevices(deviceList);
if (nbrDevices >= 0)
{
return deviceList.ToString().Split(new char[] { ',' });
}
else
{
MessageBox.Show(nbrDevices.ToString() +
" (reason: " + WSAGetLastError() + ")");
return new string[0];
}
}