0

I am writing a bluetooth file transfer from my PC to Samsung galaxy using 32Feet.net Following is the code,i am getting like:

  1. Internal server error final
  2. On my mobile set i saw file transfer but incomplete and message "remote device disconnected"
  3. I tried to send file directly from my pc and it succeeded but using C# it did not work.

I tried 32Feet.net and some other blogs but could not get through.I read i should do pairing but dont know how to do it. Please help me out of this.

private void sendFile()
{
    SelectBluetoothDeviceDialog dialog = new SelectBluetoothDeviceDialog();

    //    dialog.ShowAuthenticated = true;

    dialog.ShowRemembered = true;

    dialog.ShowUnknown = true;

    OpenFileDialog ofd = new OpenFileDialog();
    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {

        if (ofd.ShowDialog() == DialogResult.OK)
        {
            System.Uri uri = new Uri("obex://" +      dialog.SelectedDevice.DeviceAddress + "/" + ofd.FileName);

            ObexWebRequest request = new ObexWebRequest(uri);

            request.ReadFile(ofd.FileName);


            ObexWebResponse response = (ObexWebResponse)request.GetResponse();

            MessageBox.Show(response.StatusCode.ToString());

            response.Close();

            Cursor.Current = Cursors.Default;

        }
        else
        {
            MessageBox.Show("File Not Selected");
        }
    }
    else
    {
        MessageBox.Show("Device Not Selected");
    }
}
user2793032
  • 1
  • 1
  • 4

1 Answers1

0

Pairing is something you do with Bluetooth devices before you transfer files between them. The devices have to know who they are talking to and trust each other.

On Windows XP http://support.microsoft.com/kb/883259

On Windows Vista, 7, or 8 go to the start menu and start typing "Bluetooth". The entries that pop up should lead you the right direction.

Bennett Elder
  • 118
  • 1
  • 8