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

PeerEndPoint 物件已經處置。

備註

呼叫端不需要登入基礎結構, 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

PeerEndPoint 物件已經處置。

目前應用程式的 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

PeerEndPoint 物件已經處置。

  • 目前應用程式的 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物件中。

PeerEndPoint 物件已經處置。

目前應用程式的 Id 不存在或者是空的。

備註

呼叫端不需要登入基礎結構, System.Net.PeerToPeer.Collaboration 這個方法才能順利完成。 受邀者中的 , PeerInvitationResponse 與接受邀請的受邀者不相同,無法共同作業。 如果邀請傳送至尚未安裝應用程式的遠端對等,則會自動拒絕邀請。

給呼叫者的注意事項

類別上定義了其他多載, Peer 而不是子類別 PeerContactPeerNearMe

呼叫這個方法需要 PermissionStateUnrestricted 。 當對等共同作業會話開始時,就會建立此狀態。

另請參閱

適用於