SendToPlugins/SkydriveAuth.cs
(完整代码) 1KBusing System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace SendToPlugins
{
public partial class SkydriveAuth : Form
{
private string _authCode;
public SkydriveAuth()
{
InitializeComponent();
}
public string AuthCode
{
get
{
return _authCode;
}
}
// 下载于www.51aspx.com
private static string scope = "wl.skydrive_update";
private static string client_id = "000000004C0DF826";
private static Uri signInUrl = new Uri(String.Format(@"https://login.live.com/oauth20_authorize.srf?client_id={0}&redirect_uri=https://login.live.com/oauth20_desktop.srf&response_type=token&scope={1}", client_id, scope));
private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (e.Url.AbsoluteUri.Contains("#access_token="))
{
var x = e.Url.AbsoluteUri.Split(new[] { "#access_token" }, StringSplitOptions.RemoveEmptyEntries);
_authCode = x[1].Split(new[] { '&' })[0];
DialogResult = DialogResult.OK;
Close();
}
}
private void SkydriveAuth_Load(object sender, EventArgs e)
{
webBrowser.Navigate(signInUrl);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
