本文整理汇总了C#中MySqlDatabase.UpdateSoundCloudId方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.UpdateSoundCloudId方法的具体用法?C# MySqlDatabase.UpdateSoundCloudId怎么用?C# MySqlDatabase.UpdateSoundCloudId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySqlDatabase
的用法示例。
在下文中一共展示了MySqlDatabase.UpdateSoundCloudId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string scope = Request.QueryString["scope"];
string access_token = Request.QueryString["access_token"];
if (!string.IsNullOrEmpty(access_token))
{
using (Database db = new MySqlDatabase())
{
UserInfo ui = db.GetUser(Util.UserId);
ClientInfo ci = db.GetClientInfo(ui.UserId);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, "access_token", access_token);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, "scope", scope);
db.UpdateSoundCloudId(ci.ClientId, GetUserData(access_token));
}
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string retUrl = Request.Params["url"].Trim('#');
string accessToken = string.Empty;
using (Database db = new MySqlDatabase())
{
ClientInfo ci = db.GetClientInfo(Util.UserId);
string[] kvps = retUrl.Split('&');
foreach (string kvp in kvps)
{
string[] parts = kvp.Split('=');
if (parts.Length == 2)
{
string key = parts[0];
string val = parts[1];
if (val.EndsWith(",/social/soundcloud.aspx"))
val = val.Substring(0, val.Length - ",/social/soundcloud.aspx".Length);
if (string.Compare(key, "access_token", true) == 0)
accessToken = val;
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, key, val);
}
}
}
if (!string.IsNullOrEmpty(accessToken))
{
string userName = GetUserData(accessToken);
using (Database db = new MySqlDatabase())
{
UserInfo ui = db.GetUser(Util.UserId);
ClientInfo ci = db.GetClientInfo(ui.UserId);
db.UpdateSoundCloudId(ci.ClientId, userName);
}
}
}