2011-11-16 38 views

回答

0

經過短暫的「谷歌搜索」我發現:

[DllImport("BthUtil.dll")] 
private static extern int BthSetMode(RadioMode dwMode); 

[DllImport("BthUtil.dll")] 
private static extern int BthGetMode(ref RadioMode dwMode); 


/// Bluetooth states. 
public enum RadioMode 
{ 
    /// Bluetooth off. 
    Off, 
    /// Bluetooth is on but not discoverable. 
    On, 
    /// Bluetooth is on and discoverable. 
    Discoverable, 
} 

不要讓這個詞「單選」誤導你......

如果要在臺式PC上運行,你可以使用Wireless Communication Library .NET Edition

+0

但該代碼僅適用於Windows Mobile ...我需要示例代碼來顯示藍牙啓用/禁用我的Windows XP。我可能希望代碼可以在不使用Windows Mobile參考的情況下使用。 – rose

+0

@玫瑰:您正在尋找臺式機上的解決方案? – Fischermaen

+0

意思是在我的Windows XP上的筆記本電腦...是的 – rose