2009-08-31 76 views

回答

1

我會建議我的圖書館32feet.NET它在.NET提供了藍牙和OBEX支持。您可以通過OBEX輕鬆發送文件/對象,例如

' The host part of the URI is the device address, e.g. IrDAAddress.ToString(), 
' and the file part is the OBEX object name. 
Dim addr As String = "112233445566" 
Dim uri As New Uri("obex://" & addr & "/HelloWorld.txt") 
Dim req As New ObexWebRequest(uri) 
req.ReadFile("Hello World.txt") 
Dim rsp As ObexWebResponse = CType(req.GetResponse(),ObexWebResponse) 
Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode) 

User Guide,並http://32feet.codeplex.com/

我不知道郵件中的鏈接。我想如果你發送一個筆記,一個超鏈接將被識別並且用戶可以點擊它。

+0

不錯,但如何只發送一個字符串(不是文件)?我想在New Uri()構造函數中的obex://參數應該是不同的,但是哪一個? – infografnet 2013-07-01 23:31:43

+0

請參閱http://32feet.codeplex.com/wikipage?title=OBEX上的用戶指南中的「或發送本地生成的內容」。因此:使用(var content = req.GetRequestStream()){...} – alanjmcf 2013-08-01 10:47:55

相關問題