コード例 #1
0
ファイル: SampleForm.cs プロジェクト: NickPoirier/sdk-dist
        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
ファイル: SampleForm.cs プロジェクト: RELO4D3D/sdk-dist
 protected void HandleAuthTokenRequestComplete(ErrorCode result, AuthToken authToken)
 {
     if (Twitch.Error.Failed(result))
     {
         MessageBox.Show("Auth token request failed, please check your username and password and try again");
     }
     else
     {
         // cache the auth token for reuse on consecutive runs
         try
         {
             System.IO.File.WriteAllText(kAuthTokenFile, authToken.Data);
         }
         catch (Exception x)
         {
             MessageBox.Show(x.ToString());
         }
     }
 }
コード例 #3
0
ファイル: SampleForm.cs プロジェクト: NickPoirier/sdk-dist
 protected void HandleAuthTokenRequestComplete(ErrorCode result, AuthToken authToken)
 {
     if (Twitch.Error.Failed(result))
     {
         MessageBox.Show("Auth token request failed, please check your username and password and try again");
     }
     else
     {
         // cache the auth token for reuse on consecutive runs
         try
         {
             System.IO.File.WriteAllText(kAuthTokenFile, authToken.Data);
         }
         catch (Exception x)
         {
             MessageBox.Show(x.ToString());
         }
     }
 }
コード例 #4
0
ファイル: SampleForm.cs プロジェクト: RELO4D3D/sdk-dist
        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);
        }