2009-08-31 110 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