PeerContact.InviteAsync 方法

定义

为一个终结点开始一个异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。

重载

InviteAsync(Object)

为一个终结点开始一个异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。 使用指定的 Object 标识邀请。

InviteAsync(PeerEndPoint, Object)

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。 使用指定的 Object 标识邀请。

InviteAsync(PeerApplication, String, Byte[], Object)

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplication

InviteAsync(PeerEndPoint, String, Byte[], PeerApplication, Object)

为指定的 peerEndPoint 开始一个异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplication

注解

调用方无需登录到基础结构即可 System.Net.PeerToPeer.Collaboration 成功完成此方法。 PeerInvitationResponse被邀请者提供的 与接受协作邀请的被邀请者不同。 如果向尚未安装应用程序的远程对等方发送邀请,则会自动拒绝邀请。

InviteAsync(Object)

为一个终结点开始一个异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。 使用指定的 Object 标识邀请。

public:
 override void InviteAsync(System::Object ^ userToken);
[System.Security.SecurityCritical]
public override void InviteAsync (object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : obj -> unit
Public Overrides Sub InviteAsync (userToken As Object)

参数

userToken
Object

要传递给异步操作回调的用户定义的对象。 也用于标识取消的异步操作。 必须在正在进行的所有异步邀请操作中指定此参数且此参数具有唯一性。

属性

例外

UserToken 不能为 null

注解

调用方无需登录到基础结构即可 System.Net.PeerToPeer.Collaboration 成功完成此方法。 PeerInvitationResponse被邀请者提供的 与接受协作邀请的被邀请者不同。 如果向尚未安装应用程序的远程对等方发送邀请,则会自动拒绝邀请。

调用方说明

其他重载是在 类上定义的, Peer 而不是子类 PeerContactPeerNearMe

调用此方法需要 PermissionStateUnrestricted。 此状态是在对等协作会话开始时创建的。

另请参阅

适用于

InviteAsync(PeerEndPoint, Object)

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。 使用指定的 Object 标识邀请。

public:
 void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerEndPoint ^ peerEndPoint, System::Object ^ userToken);
[System.Security.SecurityCritical]
public void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerEndPoint peerEndPoint, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerEndPoint * obj -> unit
Public Sub InviteAsync (peerEndPoint As PeerEndPoint, userToken As Object)

参数

peerEndPoint
PeerEndPoint

要向其发送邀请的终结点或远程对等方。

userToken
Object

要传递给异步操作回调的用户定义的对象。 也用于标识取消的异步操作。 必须在正在进行的所有异步邀请操作中指定此参数且此参数具有唯一性。

属性

例外

  • UserToken 不能为 null

  • peerEndPoint 中的终结点不能为 null

peerEndPoint 对象不能为 null

当前应用程序的 Guid 不存在或为空。

注解

调用方无需登录到基础结构即可 System.Net.PeerToPeer.Collaboration 成功完成此方法。 PeerInvitationResponse被邀请者提供的 与接受协作邀请的被邀请者不同。 如果向尚未安装应用程序的远程对等方发送邀请,则会自动拒绝邀请。

调用方说明

其他重载是在 类上定义的, Peer 而不是子类 PeerContactPeerNearMe

调用此方法需要 PermissionStateUnrestricted。 此状态是在对等协作会话开始时创建的。

另请参阅

适用于

InviteAsync(PeerApplication, String, Byte[], Object)

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplication

public:
 override void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerApplication ^ applicationToInvite, System::String ^ message, cli::array <System::Byte> ^ invitationData, System::Object ^ userToken);
[System.Security.SecurityCritical]
public override void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerApplication applicationToInvite, string message, byte[] invitationData, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerApplication * string * byte[] * obj -> unit
Public Overrides Sub InviteAsync (applicationToInvite As PeerApplication, message As String, invitationData As Byte(), userToken As Object)

参数

applicationToInvite
PeerApplication

要为其发送邀请的应用程序。

message
String

要与应用程序邀请一起发送到远程对等方的消息。 消息的长度不能超过 255 个 Unicode 字符。

invitationData
Byte[]

与邀请关联的用户定义的数据 Blob。 其大小不能超过 16,384 字节。

userToken
Object

要传递给异步操作回调的用户定义的对象。 也用于标识取消的异步操作。 必须在正在进行的所有异步邀请操作中指定此参数且此参数具有唯一性。

属性

例外

UserToken 不能为 null

PeerApplication 对象不能为 null

  • 当前应用程序的 Guid 不存在或为空。

  • 终结点集合为空或 null

注解

调用方无需登录到基础结构即可 System.Net.PeerToPeer.Collaboration 成功完成此方法。 PeerInvitationResponse被邀请者提供的 与接受协作邀请的被邀请者不同。 如果向尚未安装应用程序的远程对等方发送邀请,则会自动拒绝邀请。

调用方说明

其他重载是在 类上定义的, Peer 而不是子类 PeerContactPeerNearMe

调用此方法需要 PermissionStateUnrestricted。 此状态是在对等协作会话开始时创建的。

另请参阅

适用于

InviteAsync(PeerEndPoint, String, Byte[], PeerApplication, Object)

为指定的 peerEndPoint 开始一个异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplication

public:
 void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerEndPoint ^ peerEndPoint, System::String ^ message, cli::array <System::Byte> ^ invitationData, System::Net::PeerToPeer::Collaboration::PeerApplication ^ applicationToInvite, System::Object ^ userToken);
[System.Security.SecurityCritical]
public void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerEndPoint peerEndPoint, string message, byte[] invitationData, System.Net.PeerToPeer.Collaboration.PeerApplication applicationToInvite, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerEndPoint * string * byte[] * System.Net.PeerToPeer.Collaboration.PeerApplication * obj -> unit
Public Sub InviteAsync (peerEndPoint As PeerEndPoint, message As String, invitationData As Byte(), applicationToInvite As PeerApplication, userToken As Object)

参数

peerEndPoint
PeerEndPoint

要向其发送邀请的终结点或远程对等方。

message
String

要与应用程序邀请一起发送到远程对等方的消息。 消息的长度不能超过 255 个 Unicode 字符。

invitationData
Byte[]

与邀请关联的用户定义的数据 Blob。 其大小不能超过 16,384 字节。

applicationToInvite
PeerApplication

要为其发送邀请的应用程序。

userToken
Object

要传递给异步操作回调的用户定义的对象。 也用于标识取消的异步操作。 必须在正在进行的所有异步邀请操作中指定此参数且此参数具有唯一性。

属性

例外

  • UserToken 不能为 null。

  • peerEndPoint 指定的终结点不能为 null

PeerApplicationPeerEndPoint 对象不能为 null对象。

当前应用程序的 Id 不存在或为空。

注解

调用方无需登录到基础结构即可 System.Net.PeerToPeer.Collaboration 成功完成此方法。 PeerInvitationResponse被邀请者提供的 与接受协作邀请的被邀请者不同。 如果向尚未安装应用程序的远程对等方发送邀请,则会自动拒绝邀请。

调用方说明

其他重载是在 类上定义的, Peer 而不是子类 PeerContactPeerNearMe

调用此方法需要 PermissionStateUnrestricted。 此状态是在对等协作会话开始时创建的。

另请参阅

适用于