如何通过蓝牙连接从Android手机发送多个图片到电脑。我制作了发送单个图像/文件的应用程序。这个应用程序使用32feet.net和OBEX。
这是我的代码:
ObexListener.mBtListener = new ObexListener(ObexTransport.Bluetooth);
mBtListener.Start();
while (this.mBtListener.IsListening)
{
Console.WriteLine("work...{0}", DateTime.Now);
// For each connection`enter code here`
ObexListenerContext obex_context = this.mBtListener.GetContext();
if (obex_context != null)
{
try
{
ObexListenerRequest req = obex_context.Request;
int counter = this.TotalCount(req);
string save_as = this.ListenerToFileName(req, this.mUploadFolder);
if (this.IsImage(Path.GetFileName(save_as)))
{
req.WriteFile(save_as);
}
}
finally
{
}
}
}