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


C# MySqlDatabase.RemoveSocialCredential方法代码示例

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


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

示例1: Page_PreRender

        protected void Page_PreRender(Object o, EventArgs e)
        {
            using (Database db = new MySqlDatabase())
            {
                ClientInfo ci = db.GetClientInfo(Util.UserId);

                bool isNotExpired = true;

                Facebook.AuthenticationService authService = new Facebook.AuthenticationService();

                Facebook.Me me;
                string accessToken = string.Empty;

                if (authService.TryAuthenticate(out me, out accessToken))
                {
                    isNotExpired = true;
                }
                else
                {
                    db.RemoveSocialCredential(ci.ClientId, SocialConnector.Facebook);
                    db.UpdateFacebookID(ci.ClientId);

                    isNotExpired = false;
                }

                if (!string.IsNullOrEmpty(ci.SoundCloudId))
                    SoundcloudItag.Attributes.Add("class", "soundcloud");
                else
                    SoundcloudItag.Attributes.Add("class", "soundcloud disabled");

                if (isNotExpired)
                    FacebookHeading.Attributes.Add("class", "social facebook");
                else
                    FacebookHeading.Attributes.Add("class", "social facebook disabled");

                if (!string.IsNullOrEmpty(ci.TwitterId))
                    TwitterHeading.Attributes.Add("class", "social twitter");
                else
                    TwitterHeading.Attributes.Add("class", "social twitter disabled");
            }
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:41,代码来源:Promo.aspx.cs

示例2: RemoveTwitter_Submit

        protected void RemoveTwitter_Submit(object sender, EventArgs e)
        {
            using (Database db = new MySqlDatabase())
            {
                ClientInfo ci = db.GetClientInfo(Util.UserId);

                db.RemoveSocialCredential(ci.ClientId, SocialConnector.Twitter);
                db.UpdateTwitterID(ci.ClientId);
            }

            UserInformation();
            FillAccountInformation();

            Session["RemoveBtnIsFired"] = true;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:15,代码来源:Profile.aspx.cs

示例3: FillFacebookInfo

        private bool FillFacebookInfo(ClientInfo ManagedUserInfo)
        {
            if (ManagedUserInfo != null)
                if (!string.IsNullOrEmpty(ManagedUserInfo.FacebookId))
                {
                    using (Database db = new MySqlDatabase())
                    {
                        ClientInfo ci = db.GetClientInfo(Convert.ToInt64(Session["managed.userid"]));

                        Session["FBACC"] = db.GetSocialCredential(ci.ClientId, SocialConnector.Facebook, "accesstoken");

                        string expiresRaw = db.GetSocialCredential(ci.ClientId, SocialConnector.Facebook, "accesstokenexpires");

                        Facebook.AuthenticationService authServices = new Facebook.AuthenticationService();

                        if (authServices.TryAuthenticateAdminFBCred(expiresRaw, Convert.ToString(Session["FBACC"])))
                        {
                            Me me = authServices.GetMe(Convert.ToString(Session["FBACC"]));

                            try
                            {
                                Session["FBID"] = me.Id;
                            }
                            catch { }

                            FillFBFriendList(Convert.ToString(Session["FBACC"]));

                            FillFBPageList(Convert.ToString(Session["FBACC"]));

                            cbxShareToUserWall.Enabled = true;

                            cbxShareToUserWall.Visible = true;

                            divShareToUserWall.Visible = true;

                            return true;
                        }
                        else
                        {
                            Session["FBACC"] = Session["FBID"] = null;

                            db.RemoveSocialCredential(ci.ClientId, SocialConnector.Facebook);

                            db.UpdateFacebookID(ci.ClientId);

                            FillFBFriendList(null);

                            FillFBPageList(null);

                            cbxShareToUserWall.Enabled = false;

                            cbxShareToUserWall.Visible = false;

                            divShareToUserWall.Visible = false;

                            return false;
                        }
                    }
                }

            Session["FBACC"] = Session["FBID"] = null;

            FillFBFriendList(null);

            FillFBPageList(null);

            cbxShareToUserWall.Enabled = false;

            cbxShareToUserWall.Visible = false;

            divShareToUserWall.Visible = false;

            return false;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:74,代码来源:RegisterDocManaged.aspx.cs

示例4: FillOwnFacebookInfo

        private bool FillOwnFacebookInfo()
        {
            if (!string.IsNullOrEmpty(_ManAccClientInfo.FacebookId))
            {
                using (Database db = new MySqlDatabase())
                {
                    ClientInfo ci = db.GetClientInfo(Util.UserId);

                    AuthenticationService authServices = new AuthenticationService();

                    Me me;

                    string accessToken = string.Empty;

                    if (authServices.TryAuthenticate(out me, out accessToken))
                    {
                        Session["FBOwnACC"] = accessToken;

                        try
                        {
                            Session["FBOwnID"] = me.Id;
                        }
                        catch { }

                        FillOwnFBFriendList(Convert.ToString(Session["FBOwnACC"]));

                        FillOwnFBPageList(Convert.ToString(Session["FBOwnACC"]));

                        cbxShareToMyWall.Enabled = true;

                        cbxShareToMyWall.Visible = true;

                        divShareToMyWall.Visible = true;

                        return true;
                    }
                    else
                    {
                        Session["FBOwnACC"] = Session["FBOwnID"] = null;

                        db.RemoveSocialCredential(ci.ClientId, SocialConnector.Facebook);

                        db.UpdateFacebookID(ci.ClientId);

                        FillOwnFBFriendList(null);

                        FillOwnFBPageList(null);

                        cbxShareToMyWall.Enabled = false;

                        cbxShareToMyWall.Visible = false;

                        divShareToMyWall.Visible = false;

                        return false;
                    }
                }
            }

            Session["FBOwnACC"] = Session["FBOwnID"] = null;

            FillOwnFBFriendList(null);

            FillOwnFBPageList(null);

            cbxShareToMyWall.Enabled = false;

            cbxShareToMyWall.Visible = false;

            divShareToMyWall.Visible = false;

            return false;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:73,代码来源:RegisterDocManaged.aspx.cs

示例5: FillManagedArtistDropDown

        private void FillManagedArtistDropDown()
        {
            ddlManagedArtist.Items.Clear();
            ddlManagedArtist.Items.Add(new ListItem("---", "0"));

            using (Database db = new MySqlDatabase())
            {
                UserInfo[] uis = db.GetManagedUsers(Util.UserId, 1);

                foreach (UserInfo ui in uis)
                {
                    ClientInfo ci = db.GetClientInfo(ui.UserId);
                    ddlManagedArtist.Items.Add(new ListItem(ci.GetFullName(), ui.UserId.ToString()));
                }

                if (!string.IsNullOrEmpty(Request["id"]))
                {
                    Session["managed.userid"] = Convert.ToInt64(Request["id"]);

                    IsrcHandle.Text = GetIsrcCode(Convert.ToInt64(Session["managed.userid"]));

                    ddlManagedArtist.SelectedValue = Request.QueryString["id"].ToString();

                    ClientInfo _ManagedUserInfo = db.GetClientInfo(Convert.ToInt64(Request.QueryString["id"]));

                    string accessToken = db.GetSocialCredential(_ManagedUserInfo.ClientId, SocialConnector.Facebook, "accesstoken");

                    string expiresRaw = db.GetSocialCredential(_ManagedUserInfo.ClientId, SocialConnector.Facebook, "accesstokenexpires");

                    bool isNotExpired = true;

                    Facebook.AuthenticationService authService = new Facebook.AuthenticationService();

                    if (authService.TryAuthenticateAdminFBCred(expiresRaw, accessToken))
                    {
                        isNotExpired = true;
                    }
                    else
                    {
                        db.RemoveSocialCredential(_ManagedUserInfo.ClientId, SocialConnector.Facebook);
                        db.UpdateFacebookID(_ManagedUserInfo.ClientId);

                        isNotExpired = false;
                    }

                }
            }
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:48,代码来源:RegisterDocManaged.aspx.cs

示例6: FillFacebookInfo

        private bool FillFacebookInfo()
        {
            if (!string.IsNullOrEmpty(_clientInfo.FacebookId))
            {
                using (Database db = new MySqlDatabase())
                {
                    ClientInfo ci = db.GetClientInfo(Util.UserId);

                    AuthenticationService authServices = new AuthenticationService();

                    Me me;

                    string accessToken = string.Empty;

                    if (authServices.TryAuthenticate(out me, out accessToken))
                    {
                        Session["FBACC"] = accessToken;

                        try
                        {
                            Session["FBID"] = me.Id;
                        }
                        catch { }

                        Session["AppId"] = db.GetSetting("facebook.app_id");

                        Session["AppSecret"] = db.GetSetting("facebook.app_secret");

                        cbxSendToFacebook.Enabled = true;

                        FacebookMsg.Enabled = true;

                        cbxSendToFacebook.Visible = true;

                        return true;
                    }
                    else
                    {
                        Session["FBACC"] = Session["FBID"] = Session["AppId"] = Session["AppSecret"] = null;

                        db.RemoveSocialCredential(ci.ClientId, SocialConnector.Facebook);
                        db.UpdateFacebookID(ci.ClientId);

                        cbxSendToFacebook.Enabled = false;

                        FacebookMsg.Enabled = false;

                        cbxSendToFacebook.Visible = false;

                        return false;
                    }
                }
            }

            Session["FBACC"] = Session["FBID"] = Session["AppId"] = Session["AppSecret"] = null;

            cbxSendToFacebook.Enabled = false;

            FacebookMsg.Enabled = false;

            cbxSendToFacebook.Visible = false;

            return false;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:64,代码来源:RegisterDocument.aspx.cs

示例7: RemoveSoundCloud_Submit

        protected void RemoveSoundCloud_Submit(object sender, CommandEventArgs e)
        {
            using (Database db = new MySqlDatabase())
            {
                ClientInfo ci = db.GetClientInfo(Util.UserId);

                db.RemoveSocialCredential(ci.ClientId, SocialConnector.SoundCloud);
                db.UpdateSoundCloudID(ci.ClientId);
            }

            UserInformation();
            FillAccountInformation();
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:13,代码来源:ProfileReg.aspx.cs


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