当前位置: 首页>>代码示例>>C#>>正文


C# Flickr.AuthCalcUrl方法代码示例

本文整理汇总了C#中FlickrNet.Flickr.AuthCalcUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Flickr.AuthCalcUrl方法的具体用法?C# Flickr.AuthCalcUrl怎么用?C# Flickr.AuthCalcUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FlickrNet.Flickr的用法示例。


在下文中一共展示了Flickr.AuthCalcUrl方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Login

        public void Login()
        {
            // Create Flickr instance
            m_flickr = new Flickr(API_KEY, SECRET);

            m_frob = m_flickr.AuthGetFrob();

            string flickrUrl = m_flickr.AuthCalcUrl(m_frob, AuthLevel.Write);

            // The following line will load the URL in the users default browser.
            System.Diagnostics.Process.Start(flickrUrl);

            bool bIsAuthorized = false;
            m_auth = new Auth();

            // do nothing until flickr authorizes.
            while (!bIsAuthorized)
            {
                try
                {
                    m_auth = m_flickr.AuthGetToken(m_frob);
                    m_flickr.AuthToken = m_auth.Token;
                }
                catch (FlickrException ex)
                {
                    ;
                }

                if (m_flickr.IsAuthenticated)
                {
                    bIsAuthorized = true;
                }
            }
        }
开发者ID:pvt10rr,项目名称:pvt10flickr,代码行数:34,代码来源:FlickrAddon.cs

示例2: OpenAuthURL

 public static void OpenAuthURL()
 {
     Flickr flickr = new Flickr(ApiKey, SharedSecret);
     frob = flickr.AuthGetFrob();
     AuthUrl = flickr.AuthCalcUrl(frob, AuthLevel.Write);
     System.Diagnostics.Process.Start(AuthUrl);
 }
开发者ID:adamlamers,项目名称:Clipboard-Manager,代码行数:7,代码来源:FlickrManager.cs

示例3: Backup

        public Backup(string apiKey, string sharedSecret)
        {
            flickr = new Flickr(apiKey, sharedSecret);

            Frob = flickr.AuthGetFrob();

            AuthToken = flickr.AuthCalcUrl(Frob, AuthLevel.Write);
        }
开发者ID:igmar,项目名称:HUSACCT,代码行数:8,代码来源:Backup.cs

示例4: Step1Button_Click

        private void Step1Button_Click(object sender, EventArgs e)
        {
            Flickr flickr = new Flickr(ApiKey.Text, SharedSecret.Text);

            Frob = flickr.AuthGetFrob();

            OutputTextbox.Text += "Frob = " + Frob + "\r\n";

            string url = flickr.AuthCalcUrl(Frob, AuthLevel.Write);

            OutputTextbox.Text += "Url = " + url + "\r\n";

            System.Diagnostics.Process.Start(url);

            Step1Button.Enabled = false;
            Step2Button.Enabled = true;
            Step3Button.Enabled = true;
        }
开发者ID:kenpower,项目名称:flickdownloader,代码行数:18,代码来源:AuthenticationForm.cs

示例5: Main

 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     ReadConfig();
     if (AuthToken.Length == 0)
     {
         // Create Flickr instance
         Flickr flickr = new Flickr(Program.ApiKey, Program.SharedSecret);
         // Get Frob
         Program.tempFrob = flickr.AuthGetFrob();
         // Calculate the URL at Flickr to redirect the user to
         string flickrUrl = flickr.AuthCalcUrl(Program.tempFrob, AuthLevel.Read);
         // The following line will load the URL in the users default browser.
         System.Diagnostics.Process.Start(flickrUrl);
         Application.Run(new DialogAuth());
     }
     else
         Application.Run(new MainForm());
 }
开发者ID:remyoudompheng,项目名称:flickrstats,代码行数:20,代码来源:Program.cs

示例6: buttonAuthenticate_Click

        private void buttonAuthenticate_Click(object sender, EventArgs e)
        {
            Flickr flickr = new Flickr(FlickrUtils.Flickr_API_KEY, FlickrUtils.Flickr_SHARED_SECRET);

            if (string.IsNullOrEmpty(flickrFrob))
            {
                flickrFrob = flickr.AuthGetFrob();
                string url = flickr.AuthCalcUrl(flickrFrob, AuthLevel.Write);
                System.Diagnostics.Process.Start(url);
            }
            else
            {
                flickrFrob = string.Empty;
                Auth auth = flickr.AuthGetToken(flickrFrob);
                textBoxAuthToken.Text = auth.Token;
            }
        }
开发者ID:ploufs,项目名称:Greenshot-Flickr-Plugin,代码行数:17,代码来源:SettingsForm.cs

示例7: FlickrGetToken

        private string FlickrGetToken()
        {
            try
            {
                Flickr f = new Flickr(Properties.Settings.Default.FlickrApiKey, Properties.Settings.Default.FlickrShared);
                f.Proxy = GetProxy(true);

                string Frob = f.AuthGetFrob();
                string url = f.AuthCalcUrl(Frob, AuthLevel.Read | AuthLevel.Write | AuthLevel.Delete);
                System.Diagnostics.Process.Start(url);

                if (messages_level==MessagesLevel.MessagesNone || MessageBox.Show("Please confirm that you've authorized FlickrSync to access your flickr account", "Confirmation", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    Auth auth = f.AuthGetToken(Frob);
                    Properties.Settings.Default.FlickrToken = auth.Token;
                    SaveConfig();
                    return Properties.Settings.Default.FlickrToken;
                }
            }
            catch (Exception e)
            {
                if (Properties.Settings.Default.FlickrToken == "")
                    Error("Unable to obtain Flickr Token", e, ErrorType.Connect);
                else
                    Error("Error obtaining Flickr Token", e, ErrorType.Normal);
            }

            return "";
        }
开发者ID:udif,项目名称:FlickrSync,代码行数:29,代码来源:FlickrSync.cs

示例8: OnAuthBtnClicked

 protected virtual void OnAuthBtnClicked(object sender, EventArgs e)
 {
     flickr = new FlickrNet.Flickr (ApiKey, ApiSecret);
     Frob = flickr.AuthGetFrob ();
     Services.Environment.OpenUrl (flickr.AuthCalcUrl (Frob, AuthLevel.Write));
     Widget image = auth_btn.Image;
     auth_btn.Label = AddinManager.CurrentLocalizer.GetString ("Click to complete authorization");
     auth_btn.Image = image;
     auth_btn.Clicked -= new EventHandler (OnAuthBtnClicked);
     auth_btn.Clicked += new EventHandler (OnCompleteBtnClicked);
 }
开发者ID:jrudolph,项目名称:do-plugins,代码行数:11,代码来源:AccountConfig.cs

示例9: GetFrobAuthUrl

 public string GetFrobAuthUrl()
 {
     _flickrObj = CreateFlickr();
     _frob  = _flickrObj.AuthGetFrob();
     return _flickrObj.AuthCalcUrl(_frob, AuthLevel.Write);
 }
开发者ID:aviatgithub,项目名称:FlickrBulkUploader,代码行数:6,代码来源:FlickrProxy.cs

示例10: AuthorizeFlickrButton_Click

 private void AuthorizeFlickrButton_Click(object sender, EventArgs e)
 {
     // Create Flickr instance
     Flickr flickr = new Flickr(Program.FlickrAPIKey, Program.FlickrSharedSecretKey);
     // Get Frob
     tempFrob = flickr.AuthGetFrob();
     // Calculate the URL at Flickr to redirect the user to
     string flickrUrl = flickr.AuthCalcUrl(tempFrob, AuthLevel.Write);
     // The following line will load the URL in the users default browser.
     System.Diagnostics.Process.Start(flickrUrl);
     CompleteAuthButton.Enabled = true;
 }
开发者ID:DefStevo,项目名称:defstevo-collection,代码行数:12,代码来源:OptionsForm.cs


注:本文中的FlickrNet.Flickr.AuthCalcUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。