예제 #1
0
파일: Ludum.cs 프로젝트: NoHuman/Mini
        private bool PerformLogin(LoginEventArgs args)
        {
            using (var jsonClient = new JsonServiceClient(BaseUrl))
            {
                //jsonClient.SetCredentials("morten", "pass");
                jsonClient.HttpMethod = "POST";

                var login = new LoginUser
                                {
                                    Username = args.Username,
                                    Password = args.Password,
                                };
                var loginResponse = jsonClient.Send<LoginUserResponse>(login);
                if (loginResponse.Successful)
                {
                    _loginScreen.Enabled = false;
                    _loginScreen.Visible = false;
                }
                //jsonClient.AlwaysSendBasicAuthHeader = true;
                //jsonClient.SendOneWay(move);
            }
            return true;
        }
예제 #2
0
파일: LoginScreen.cs 프로젝트: NoHuman/Mini
 private bool TryLogin()
 {
     if (_txtPassword.Text == null)
     {
         return false;
     }
     if (_txtPassword.Text.Length < 8)
     {
         return false;
     }
     if (_txtUsername.Text == null)
     {
         return false;
     }
     if (AcceptedCredentials != null)
     {
         var args = new LoginEventArgs
                        {
                            Username = _txtUsername.Text,
                            Password = _txtPassword.Text
                        };
         AcceptedCredentials(args);
     }
     return true;
 }