private void btn_opt_Click(object sender, EventArgs e) { BluetoothRadioMode mod = BluetoothRadioMode.On; int ret = mDev.BtGetMode(ref mod); MessageBox.Show(mod.ToString()); ret = 0; try { ret = mDev.BthSetMode(BluetoothRadioMode.Off); MessageBox.Show("返回结果为" + ret.ToString()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static extern int BthSetMode(BluetoothRadioMode mode);
public static extern int BthGetMode(ref BluetoothRadioMode mode);
public static extern int BthGetMode(out BluetoothRadioMode dwMode);
public static extern int BthSetMode(BluetoothRadioMode dwMode);