Peer.Invite Peer.Invite Peer.Invite Peer.Invite Method

定義

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

多載

Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[])

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

Invite() Invite() Invite() Invite()

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[]) Invite(PeerApplication, String, Byte[])

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

public:
 abstract System::Net::PeerToPeer::Collaboration::PeerInvitationResponse ^ Invite(System::Net::PeerToPeer::Collaboration::PeerApplication ^ applicationToInvite, System::String ^ message, cli::array <System::Byte> ^ invitationData);
public abstract System.Net.PeerToPeer.Collaboration.PeerInvitationResponse Invite (System.Net.PeerToPeer.Collaboration.PeerApplication applicationToInvite, string message, byte[] invitationData);
abstract member Invite : System.Net.PeerToPeer.Collaboration.PeerApplication * string * byte[] -> System.Net.PeerToPeer.Collaboration.PeerInvitationResponse
Public MustOverride Function Invite (applicationToInvite As PeerApplication, message As String, invitationData As Byte()) As PeerInvitationResponse

參數

applicationToInvite
PeerApplication PeerApplication PeerApplication PeerApplication

邀請會傳送給 PeerApplicationThe PeerApplication for which the invitation is sent.

message
String String String String

要隨應用程式邀請傳送到遠端對等的訊息。A message to send to the remote peer along with the application invitation. 訊息不得超過 255 個 Unicode 字元。The message can be no more than 255 Unicode characters.

invitationData
Byte[]

使用者定義的資料 Blob,用於與邀請建立關聯。A user defined data blob to associate with the invitation. 大小可超過 16,384 個位元組。Its size can be no more than 16,384 bytes.

傳回

PeerInvitationResponse,來自收到邀請的對等電腦。A PeerInvitationResponse from the peer that received the invitation.

例外狀況

沒有為共同作業註冊應用程式。The application is not registered for collaboration.

invitationData 大於 16,384 個位元組。invitationData is larger than 16,384 bytes.

- 邀請期間發生錯誤。- An error occurred during the invitation process.

- 目前正在執行的應用程式並未向對等共同作業基礎結構註冊。- The currently executing application is not registered with the peer collaboration infrastructure.

備註

呼叫這個方法需要PermissionStateUnrestrictedCalling this method requires a PermissionState of Unrestricted. 對等共同作業工作階段開始時,會建立此狀態。This state is created when the peer collaboration session begins.

Invite() Invite() Invite() Invite()

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

public:
 abstract System::Net::PeerToPeer::Collaboration::PeerInvitationResponse ^ Invite();
public abstract System.Net.PeerToPeer.Collaboration.PeerInvitationResponse Invite ();
abstract member Invite : unit -> System.Net.PeerToPeer.Collaboration.PeerInvitationResponse
Public MustOverride Function Invite () As PeerInvitationResponse

傳回

PeerInvitationResponse,來自收到邀請的對等電腦。A PeerInvitationResponse from the peer that received the invitation.

例外狀況

- 邀請期間發生錯誤。- An error occurred during the invitation process.

- 目前正在執行的應用程式並未向對等共同作業基礎結構註冊。- The currently executing application is not registered with the Peer Collaboration infrastructure.

備註

呼叫這個方法需要PermissionStateUnrestrictedCalling this method requires a PermissionState of Unrestricted. 對等共同作業工作階段開始時,會建立此狀態。This state is created when the Peer Collaboration session begins.

另請參閱

適用於