导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

PeerFinder Class

使您可以在邻近设备上发现您应用程序的另一个实例,并使用点击笔势或浏览在对等类应用程序之间创建套接字连接。

语法


public ref class PeerFinder abstract sealed 

特性

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

成员

PeerFinder类 具有这些类型的成员:

事件

PeerFinder类 具有这些事件。

事件说明
ConnectionRequested Occurs when a remote peer requests a connection using the ConnectAsync method.
TriggeredConnectionStateChanged Occurs during a tap gesture from a remote peer.

 

方法

The PeerFinder 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
ConnectAsync Connects to a peer discovered by a call to the FindAllPeersAsync method.
CreateWatcher Creates a new instance of a PeerWatcher object for dynamic discovery of peer apps.
FindAllPeersAsync Asynchronously browses for peer computers that are running the same app within wireless range.
Start() Starts the process of finding peer apps and makes an app discoverable to remote peers.
Start(String) Delivers a message to a peer app on a proximate device.
Stop Stops the process of finding peer apps or advertising for a peer connection.

 

属性

PeerFinder类 具有这些属性。

属性访问类型说明

AllowBluetooth

读/写Specifies whether the PeerFinder class may connect a StreamSocket object by using Bluetooth.

AllowInfrastructure

读/写Specifies whether the PeerFinder class may connect to a StreamSocket object using TCP/IP.

AllowWiFiDirect

读/写Specifies whether the PeerFinder class may connect a StreamSocket object by using Wi-Fi Direct.

AlternateIdentities

只读Gets a list of alternate appId values to match with peer applications on other platforms.

DiscoveryData

读/写Gets or sets the name that identifies your computer to remote peers.

DisplayName

读/写Gets or sets the name that identifies your computer to remote peers.

Role

读/写Gets or sets the role of the app in peer-to-peer connections.

SupportedDiscoveryTypes

只读Gets a value that indicates which discovery options are available to use with the PeerFinder class.

 

备注

重要事项  

邻近 API 不提供身份验证、加密或消息的完整性。不要使用邻近感应来交换用户敏感信息,如密码、财务数据、文本消息、电子邮件、照片或身份证号码。

示例

目前没有可用的代码示例或不支持该语言。

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

最低支持电话

Windows Phone 8

命名空间

Windows.Networking.Proximity
Windows::Networking::Proximity [C++]

元数据

Windows.winmd

Capabilities

proximity
ID_CAP_PROXIMITY [Windows Phone]
ID_CAP_NETWORKING [Windows Phone]

另请参见

接近程度和轻击 (JavaScript)
接近程度和轻击 (C#/VB/C++)
示例
接近程度示例

 

 

Microsoft 正在进行一项网上调查,以了解您对 MSDN 网站的意见。 如果您选择参加,我们将会在您离开 MSDN 网站时向您显示该网上调查。

是否要参加?
显示:
© 2014 Microsoft