Beispiel #1
0
        private void btnAuth_Click(object sender, EventArgs e)
        {
            Flickr flickr = FlickrManager.GetInstance();

            // what's "oob" ?
            // I have tried "flickr-up", then error. hmm...
            RequestToken = flickr.OAuthGetRequestToken("oob");

            String uri = flickr.OAuthCalculateAuthorizationUrl(RequestToken.Token, AuthLevel.Write);

            System.Diagnostics.Process.Start(uri);
        }
Beispiel #2
0
        private void btnAuthComplete_Click(object sender, EventArgs e)
        {
            String verify = txtVerifier.Text;

            if (String.IsNullOrEmpty(verify))
            {
                MessageBox.Show("認証コードを入力してください");
                return;
            }

            Flickr flickr = FlickrManager.GetInstance();

            try
            {
                var Accsesstoken = flickr.OAuthGetAccessToken(RequestToken, verify);
                txtResult.AppendText("ok\n");
                txtResult.AppendText(Accsesstoken.FullName + "\n");
                Config.OAuthToken = Accsesstoken;
            }
            catch (FlickrApiException ex)
            {
                txtResult.AppendText(ex.ToString());
            }
        }