Creating basic file transfer between 2 applications on 2 computers using bluetooth in C#
First,
- I don't want to pair the 2 computers manually.
- I don't want to use inbuilt bluetooth software to transfer file
- I don't won't windows to control my Bluetooth
- All done on Windows 7 computers (32Feet.net can be also applied if necessary)
I want to create two applications, say each knows of the other. Put them in two different computers and make them run. so each will turn on their Bluetooth antennas, and then the Two applications will connect using the bluetooth, and a file is sent from one to the other. thats really all.
How can I basically achieve this, can someone guide me?
A开发者_如何学Pythonlso I got 2 questions:
- How can i set one application to broadcast a message that it exists over bluetooth.
- How can the other detect this and connect to that computer using Bluetooth
One idea i have is to connect to each nearby computer iteratively and then search if the application exists, and then pair them automatically through the application itself (not by windows manually) and send the file.
You can use my library 32feet.NET. :-) To send the file use the class ObexWebRequest
or for more advanced OBEX use see the partner library Brecham.Obex. To discovery devices in range use BluetoothClient.DiscoverDevices
or BluetoothComponent.DiscoverDevicesAsync
. To respond to any authentication requests use class BluetoothWin32Authentication
. :-)
See the user guide at 32feet.NET User Guide
I would suggest that if both computer are on the same network. That you simply create a tcp listener on the receiving computer and send the file in byte array to it from the sending computer.
精彩评论