I'm tried to send file from pc to mobile via bluetooth.But it was not working. i'm using the IntheHand.net. dll for bluetooth transmission. But output of my program is BADREQUEST. i tried it lot of time but i was not working.This is my code. Help me please
Private Sub sendbtn_Click(sender As Object, e As EventArgs) Handles sendbtn.Click If ListBox1.SelectedIndex = -1 Then MessageBox.Show("select the device !", "", MessageBoxButtons.OK, MessageBoxIcon.Information) Exit Sub End If Dim ofd As New OpenFileDialog() ofd.Title = "Select File" ofd.Filter = "All Files (*.*)|*.*" Try If ofd.ShowDialog() = DialogResult.OK Then Cursor.Current = Cursors.WaitCursor Dim uri As System.Uri = New Uri(("obex://" & ListBox1.SelectedIndex.ToString() & "/") + System.IO.Path.GetFileName(ofd.FileName)) Dim request As New ObexWebRequest(uri) request.ReadFile(ofd.FileName) Dim response As ObexWebResponse = DirectCast(request.GetResponse(), ObexWebResponse) 'MessageBox.Show(response.StatusCode.ToString()) If response.StatusCode.ToString.Trim = "BadRequest" Then Label7.Text = "Not success" Label7.ForeColor = Color.Red ElseIf response.StatusCode.ToString.Trim = "OK, Final" Then Label7.Text = "Success" Label7.ForeColor = Color.LightGreen Else Label7.Text = "Error: : " & vbCrLf & _ response.StatusCode.ToString.Trim End If response.Close() Cursor.Current = Cursors.[Default] End If Catch ex As Exception MsgBox(Err.Description) End Try ListBox1.SelectedIndex = -1 End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)