Exemplo n.º 1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            // Get the user name and password from the user.
            string userName = textBoxUserName.Text;
            string password = textBoxPassword.Text;

            textBoxRequest.Text  = "Request comes here";
            textBoxResponse.Text = "Response comes here. This may take secones. Please wait...";
            this.Update();

            // Here is the main part that we call Glue login
            m_authToken = glueCall.Login(userName, password);

            // Show the request and response in the form.
            // This is for learning purpose.
            IRestResponse response = glueCall.m_lastResponse;

            textBoxRequest.Text  = response.ResponseUri.AbsoluteUri;
            textBoxResponse.Text = response.Content;
        }
Exemplo n.º 2
0
        //=========================================================
        //  Login/Logout
        //=========================================================
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            // Get the user name and password from the user.
            string userName = textBoxUserName.Text;
            string password = textBoxPassword.Text;

            InitRequestResponse();
            this.Update();

            // Here is the main part that we call Glue login
            m_authToken = Glue.Login(userName, password);

            // If success, change the button to logout.
            if (m_authToken != null && m_authToken.Length > 0)
            {
                buttonLogin.Enabled  = false;
                buttonLogout.Enabled = true;
            }

            // Show the request and response in the form.
            // This is for learning purpose.
            ShowRequestResponse();
        }