1

32feetライブラリを使用してモバイル デバイスから連絡先を読み取ろうとしていますが、試してみると不正な要求エラーが発生します。デバイスはアプリとペアリングされています。これは私のコードです:

var item = (BluetoothDeviceInfo)listBox.SelectedItem;
Task.Run(() =>
{
    item.Update();
    item.Refresh();

    item.SetServiceState(BluetoothService.PhonebookAccess, true);

    if (OBEXOpenStream(item.DeviceAddress.ToString()))
    {
        if (OBEXConnect())
        {
            string tName = "";
            string tType = "text/x-vCard";
            string tFileContent = "";
            int result = OBEXRequest("GET", tName, tType, tFileContent);

            item.ShowDialog();
        }
    }
    OBEXCloseStream();

});

OBEX を使用して連絡先を取得する別の方法があるかどうかはわかりません。

4

1 に答える 1