コード例 #1
0
ファイル: Program.cs プロジェクト: faturita/SSLClient
        public static void DoLogin()
        {
            UserPassCredential credential = new UserPassCredential();

            credential.userName = "******";
            credential.password = "******";

            AuthenticationServiceClient client = new AuthenticationServiceClient();

            try
            {
                ContextInformationInspector behavior = new ContextInformationInspector();
                client.Endpoint.Behaviors.Add((IEndpointBehavior)behavior);

                AuthenticatedToken token = client.LogInUserPass(credential);
                TokenManager.Instance.LoadToken(token);
                client.Close();
            }
            catch (Exception ex)
            {
                client.Abort();
            }
        }