本文整理汇总了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;
}
}
}
示例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);
}
示例3: Backup
public Backup(string apiKey, string sharedSecret)
{
flickr = new Flickr(apiKey, sharedSecret);
Frob = flickr.AuthGetFrob();
AuthToken = flickr.AuthCalcUrl(Frob, AuthLevel.Write);
}
示例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;
}
示例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());
}
示例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;
}
}
示例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 "";
}
示例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);
}
示例9: GetFrobAuthUrl
public string GetFrobAuthUrl()
{
_flickrObj = CreateFlickr();
_frob = _flickrObj.AuthGetFrob();
return _flickrObj.AuthCalcUrl(_frob, AuthLevel.Write);
}
示例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;
}