I'm creating a WPF application for sending and receiving files over bluetooth. I'm using 32feet library for the same. I can send files using ObexObjectPush bluetooth service.
But when files are received using the technique, specified here, are not captured by my application, instead my computer captures it.
Here is my code:
private void Listener(CancellationTokenSource token)
{
try
{
while (true)
{
using (var client = _listener.AcceptBluetoothClient())
{
if (token.IsCancellationRequested)
{
return;
}
using (var streamReader = new StreamReader(client.GetStream()))
{
try
{
// ... Custom operation
//....
}
catch (IOException ex)
{
client.Close();
break;
}
}
}
}
}
catch (Exception exception)
{
// todo handle the exception
}
}
All I want to do is to capture all file received using bluetooth. Presently my system shows a popup for receiving file. I want to override this behaviour and want my application to receive it.
Any help in this will be highly appreciated.