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 此状态。

适用于

另请参阅