PeerCollaboration.SignIn(PeerScope) 方法

定義

使用指定的 PeerScope 將對等登入至共同作業基礎結構。

public:
 static void SignIn(System::Net::PeerToPeer::Collaboration::PeerScope peerScope);
[System.Security.SecurityCritical]
public static void SignIn (System.Net.PeerToPeer.Collaboration.PeerScope peerScope);
[<System.Security.SecurityCritical>]
static member SignIn : System.Net.PeerToPeer.Collaboration.PeerScope -> unit
Public Shared Sub SignIn (peerScope As PeerScope)

參數

peerScope
PeerScope

對等用來加入 PeerCollaboration 活動的範圍。

屬性

例外狀況

peerScope 設定為 None

peerScope 參數包含無效的列舉值。

SignIn(PeerScope) 作業無法完成。

範例

下列程式代碼範例說明如何將使用者登入共同作業基礎結構。

//This function signs the users into the Collaboration Infrastructure.
public static bool PeerCollabSignin()
{
    bool result = false;
    try
    {
        PeerCollaboration.SignIn(PeerScope.All);
        result = true;
    }
    catch(Exception ex)
    {
        Console.WriteLine("Error signing in: {0}", ex.Message);
    }
    return result;
}

備註

顯示名稱不一定是唯一的。 使用者在接受共同作業邀請之前,應該先使用電子郵件、電話或個人顯示名稱來驗證人員的身分識別。

此函式會將使用者登入共同作業基礎結構。

存取這個方法需要 PermissionStateUnrestricted。 當共同作業會話開始時, Peer 就會建立此狀態。

適用於

另請參閱