PeerCollaboration.SignIn(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 活动使用的范围。The scope the peer is using to join the PeerCollaboration activity.
- 属性
例外
peerScope 参数包含无效枚举值。The peerScope parameter contains an invalid enumeration value.
未能完成 SignIn(PeerScope) 操作。The SignIn(PeerScope) operation could not be completed.
示例
下面的代码示例演示如何将用户登录到协作基础结构。The following code example illustrates how to sign the users into the Collaboration infrastructure.
//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;
}
注解
显示名称不一定是唯一的。Display names are not necessarily unique. 用户应在接受协作邀请之前,通过电子邮件、电话或人员来验证用户的身份。Users should verify the identity of the person using the display name by email, phone, or in person before accepting a collaboration invitation.
此函数将用户登录到协作基础结构。This function signs the users into the Collaboration Infrastructure.
对此方法的访问需要 PermissionState 的为 Unrestricted 。Access to this method requires a PermissionState of Unrestricted. 此状态是在 Peer 协作会话开始时创建的。This state is created when the Peer collaboration session begins.