string GetLoogonUserResult(CentralizedSecurity.W32.Test.ServiceReference1.LoogonUserResult loogonRes) { StringBuilder s = new StringBuilder(loogonRes.LogResult.ToString()); s.AppendLine(); s.AppendLine(loogonRes.ErrorMessage); return(s.ToString()); }
private void Authenticate_Click(object sender, EventArgs e) { txtResult.Text = string.Empty; ServiceReference1.CoreSecurityClient clientProxy = null; try { clientProxy = new ServiceReference1.CoreSecurityClient("wcf_iis"); AuthenticateService(clientProxy); CentralizedSecurity.W32.Test.ServiceReference1.LoogonUserResult loogonRes = clientProxy.Authenticate(txtAuthenticate_UserName.Text, txtAuthenticate_Password.Text, txtAuthenticate_Domain.Text); string x = GetLoogonUserResult(loogonRes); // string x = clientProxy.Test(); txtResult.Text = x; clientProxy.Close(); } catch (FaultException fx) { txtResult.Text = "FaultException\r\n" + Fwk.Exceptions.ExceptionHelper.GetAllMessageException(fx); if (clientProxy != null) { clientProxy.Abort(); } } catch (Exception err) { txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(err); if (clientProxy != null) { clientProxy.Abort(); } } }