示例#1
0
        private void mSetAuthTokenButton_Click(object sender, EventArgs e)
        {
            LoginForm frm = new LoginForm();
            frm.ShowPasswordField = false;
            DialogResult result = frm.ShowDialog();
            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            // attempt to read the previously cached authtoken from file

            string str = null;
            try
            {
                str = System.IO.File.ReadAllText(kAuthTokenFile);
            }
            catch (Exception x)
            {
                MessageBox.Show(x.ToString());
                return;
            }

            AuthToken token = new AuthToken(str);

            mBroadcastController.ClientSecret = mClientSecretText.Text;
            mBroadcastController.SetAuthToken(frm.UserName, token);
        }
示例#2
0
        private void mRequestAuthTokenButton_Click(object sender, EventArgs e)
        {
            LoginForm frm = new LoginForm();
            frm.ShowPasswordField = true;
            DialogResult result = frm.ShowDialog();
            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            mBroadcastController.ClientSecret = mClientSecretText.Text;
            mBroadcastController.RequestAuthToken(frm.UserName, frm.Password);
        }