首先搜索周围的蓝牙设备,然后查找搜索到的设备上的服务,比如,我搜索到附近一台v3手机,那么我如何知道v3手机上有什么服务可以提供?谢谢#region Using directivesusing System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;
using InTheHand.Net;
using InTheHand.IO;
#endregionnamespace DeviceApplication1
{
    /// <summary>
    /// 窗体的摘要描述。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
        private ComboBox comboBox1;
        /// <summary>
        /// 窗体的主菜单。
        /// </summary>
        private System.Windows.Forms.MainMenu mainMenu1;        public Form1()
        {
            InitializeComponent();
           
            //打开蓝牙设备
            BluetoothRadio.PrimaryRadio.Mode = RadioMode.Connectable;
           
            //新建一个bluetooth Client
            BluetoothClient BC = new BluetoothClient();
            
            //查找附近的蓝牙设备
            BluetoothDeviceInfo[] arr = BC.DiscoverDevices(12);
            
            foreach (BluetoothDeviceInfo b in arr)
            {
                this.comboBox1.Items.Clear();
                this.comboBox1.Items.Add("--------"); 
                this.comboBox1.Items.Add(b.DeviceName);
                this.comboBox1.Items.Add("1." + b.ClassOfDevice);
                this.comboBox1.Items.Add("2." + b.Connected);
                this.comboBox1.Items.Add("3." + b.DeviceAddress);
                
                System.Guid[] gui = b.InstalledServices; 
                this.comboBox1.Items.Add("4." + b.InstalledServices + gui.Length);
                this.comboBox1.Items.Add("5." + b.LastSeen);
                this.comboBox1.Items.Add("6." + b.LastUsed);
                this.comboBox1.Items.Add("7." + b.Remembered);
                this.comboBox1.Items.Add("--------");
                this.comboBox1.SelectedIndex = 1;
            }
            //关闭蓝牙
            BluetoothRadio.PrimaryRadio.Mode = RadioMode.PowerOff;
        }        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
        }        #region Windows 窗体设计器生成的代码
        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            // 
            // comboBox1
            // 
            this.comboBox1.Location = new System.Drawing.Point(3, 3);
            this.comboBox1.Size = new System.Drawing.Size(170, 24);
            // 
            // Form1
            // 
            this.ClientSize = new System.Drawing.Size(176, 180);
            this.Controls.Add(this.comboBox1);
            this.Menu = this.mainMenu1;
            this.Text = "Form1";        }        #endregion        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            Application.Run(new Form1());
        }    }
}