本文整理汇总了C#中Facebook.FacebookClient.GetLogoutUrl方法的典型用法代码示例。如果您正苦于以下问题:C# FacebookClient.GetLogoutUrl方法的具体用法?C# FacebookClient.GetLogoutUrl怎么用?C# FacebookClient.GetLogoutUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook.FacebookClient
的用法示例。
在下文中一共展示了FacebookClient.GetLogoutUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnLogout_Click
private void btnLogout_Click(object sender, EventArgs e)
{
var webBrowser = new WebBrowser();
var fb = new FacebookClient();
var logouUrl = fb.GetLogoutUrl(new { access_token = _accessToken, next = "https://www.facebook.com/connect/login_success.html" });
webBrowser.Navigate(logouUrl);
btnLogout.Visible = false;
}
示例2: button2_Click
private void button2_Click(object sender, RibbonControlEventArgs e)
{
FacebookClient fc = new FacebookClient();
LoginForm l = new LoginForm(fc.GetLogoutUrl(new
{
next = "https://www.facebook.com/connect/login_success.html",
access_token = ThisAddIn.GetAccessToken()
}).ToString(), this, false);
l.Show();
}
示例3: PostToWall
//AAAIOfwttlbABADAgOfra14zhgQi2V82yNfuscJjLIwX0rT9nqRg4YYbmxZAZByKwq0lYWVvn9f1fIfEbY3i1wmQx2tZAOtpRxqGEDlE2phqiltqLw3X
//access token for me
public static void PostToWall(string message, long userId, string wallAccessToken, WebBrowser fBrowser)
{
var fb = new FacebookClient(wallAccessToken);
string url = string.Format("{0}/{1}", userId, "feed");
var argList = new Dictionary<string, object>();
argList["message"] = message;
fb.Post(url, argList);
var fb2 = new FacebookClient();
var logoutUrl = fb.GetLogoutUrl(new { access_token = wallAccessToken, next = "https://www.facebook.com/connect/login_success.html" });
fBrowser.Navigate(logoutUrl);
}
示例4: Logout
public static void Logout()
{
FacebookClient fb = new FacebookClient();
Uri logoutUrl = fb.GetLogoutUrl(new
{
access_token = _accessToken,
next = "https://www.facebook.com/connect/login_success.html"
});
WebClient client = new WebClient();
client.DownloadString(logoutUrl);
_accessToken = null;
}
示例5: btnLogout_Click
private void btnLogout_Click(object sender, EventArgs e)
{
var fb = new FacebookClient();
var logoutUrl = fb.GetLogoutUrl(new
{
next = "https://www.facebook.com/connect/login_success.html",
access_token = _accessToken
});
var webBrowser = new WebBrowser();
webBrowser.Navigated += (o, args) =>
{
if (args.Url.AbsoluteUri == "https://www.facebook.com/connect/login_success.html")
Close();
};
webBrowser.Navigate(logoutUrl.AbsoluteUri);
}
示例6: Login
private void Login()
{
dynamic parameters = new ExpandoObject();
parameters.client_id = AppId;
parameters.redirect_uri = "https://www.facebook.com/connect/login_success.html";
parameters.response_type = "token";
parameters.display = "popup";
if (!string.IsNullOrWhiteSpace(_ExtendedPermissions))
parameters.scope = _ExtendedPermissions;
var fb = new FacebookClient();
_loginUrl = fb.GetLoginUrl(parameters);
_logoutUrl = fb.GetLogoutUrl(parameters);
webBrowser1.Navigate(_loginUrl.AbsoluteUri);
webBrowser1.Navigate(_logoutUrl.AbsoluteUri);
}
示例7: Logout
private void Logout(string accessToken)
{
var webBrowser = new WebBrowser();
var fb = new FacebookClient();
var logouUrl = fb.GetLogoutUrl(new { access_token = accessToken, next = "https://www.facebook.com/connect/login_success.html" });
webBrowser.Navigate(logouUrl);
MyAppSetting.ActiveUser = "0";
}
示例8: ProfileImage_Tapped
private void ProfileImage_Tapped(object sender, TappedRoutedEventArgs e)
{
FacebookClient fbclient = new FacebookClient();
_logoutUrl = fbclient.GetLogoutUrl(new
{
next = "https://www.facebook.com/connect/login_success.html",
access_token = App.ObjFBHelper.AccessToken,
// redirect_uri = App.ObjFBHelper._callbackUri.AbsoluteUri,
});
ProfileHelpers.IsLogin = false;
ProfileHelpers.ProfileImage = "";
WebAuthenticationBroker.AuthenticateAndContinue(_logoutUrl);
// Frame.Navigate(typeof(Login));
//BtnLogin.Visibility = Visibility.Visible;
//BtnLogout.Visibility = Visibility.Collapsed;
}
示例9: LogOffHome
public ActionResult LogOffHome()
{
Session["UserName"] = null;
Session["UserGroup"] = null;
Session["UserID"] = null;
Session["ExamineeID"] = null;
Userid = 0;
if (SessionManagement.GetSessionReturnToString("loginFBmode") != null)
{
var oauth = new FacebookClient();
var logoutParameters = new Dictionary<string, object>
{
{"access_token", Session["access_token"]},
{ "next", Url.Action("Index","Home") }
};
Session["loginFBmode"] = null;
Session["access_token"] = null;
var logoutUrl = oauth.GetLogoutUrl(logoutParameters);
return Redirect(logoutUrl.ToString());
}
return RedirectToAction("Index", "Home");
}
示例10: buttonFBlogout_Click
private void buttonFBlogout_Click(object sender, EventArgs e)
{
var webBrowser = new WebBrowser();
var fb = new FacebookClient();
var logouUrl = fb.GetLogoutUrl(new { access_token = _accessToken, next = "https://www.facebook.com/connect/login_success.html" });
webBrowser.Navigate(logouUrl);
buttonFBlogout.Visible = false;
textBox1.Text = String.Format("Logged Out from Faceboook");
}
示例11: Logout
public static string Logout(string access_token)
{
try
{
FacebookClient client = new FacebookClient(access_token);
return client.GetLogoutUrl(new { access_token = access_token, next = "https://www.facebook.com/connect/login_success.html" }).ToString();
}
catch (Exception)
{
return null;
}
}
示例12: GenerateLogoutUrl
private Uri GenerateLogoutUrl()
{
dynamic parameters = new ExpandoObject();
var fb = new FacebookClient();
return fb.GetLogoutUrl(parameters);
}
示例13: logoutBtn_Click
private void logoutBtn_Click(object sender, RoutedEventArgs e)
{
var fb = new FacebookClient();
var parameters = new Dictionary<string, object>();
parameters["next"] = "https://www.facebook.com/connect/login_success.html";
parameters["access_token"] = ifc.getCurrentUser().FbAccessToken;
var logoutUrl = fb.GetLogoutUrl(parameters);
var webBrowser = new WebBrowser();
webBrowser.Navigate(logoutUrl);
webBrowser.Navigated += (o, args) =>
{
if (args.Uri.AbsoluteUri == "https://www.facebook.com/connect/login_success.html")
{
ifc.logoutUser();
NavigationService.Navigate(new Uri("/BeatIt!;component/AppCode/Pages/Login.xaml", UriKind.Relative));
}
};
}
示例14: Logout_Click
private void Logout_Click(object sender, RoutedEventArgs e)
{
lbxMessageMyProfileMessageTB.Text = lbxGlobalScoremessageTB.Text = lbxFriendsScoremessageTB.Text = "Please wait...";
lbxGlobalScoreMessagePopup.Visibility = Visibility.Visible;
lbxFriendsScoreMessagePopup.Visibility = Visibility.Visible;
lbxMessageMyProfileMessagePopup.Visibility=Visibility.Visible;
var fb = new FacebookClient();
var parameters = new Dictionary<String, object>();
parameters["next"] = "https://www.facebook.com/connect/login_success.html";
parameters["access_token"] = GlobalContext.AccessToken;
var logouturl=fb.GetLogoutUrl(parameters);
var webBrowser = new WebBrowser();
webBrowser.Navigated += (o, args) =>
{
if (args.Uri.AbsoluteUri == "https://www.facebook.com/connect/login_success.html")
{
GlobalContext.AccessToken = null;
GlobalContext.g_UserProfile = null;
Deployment.Current.Dispatcher.BeginInvoke(delegate()
{
DBManager.getInstance().cleanData(DBManager.DB_Profile);
NavigationService.GoBack();
});
}
else
{
Deployment.Current.Dispatcher.BeginInvoke(delegate()
{
MessageBox.Show("Error,Please try again later", "Error",MessageBoxButton.OK);
});
}
lbxGlobalScoreMessagePopup.Visibility = Visibility.Collapsed;
lbxFriendsScoreMessagePopup.Visibility = Visibility.Collapsed;
lbxMessageMyProfileMessagePopup.Visibility = Visibility.Collapsed;
};
webBrowser.Navigate(logouturl);
}
示例15: button6_Click
private void button6_Click(object sender, EventArgs e)
{
var fb = new FacebookClient();
var logoutUrl = fb.GetLogoutUrl(new
{
next = "https://www.facebook.com/connect/login_success.html",
access_token = Security.DecryptString(fallyGrab.Properties.Settings.Default.fbToken,Security.encryptionPassw)
});
var webBrowser = new WebBrowser();
webBrowser.Navigated += (o, args) =>
{
if (args.Url.AbsoluteUri == "https://www.facebook.com/connect/login_success.html")
{
// update token settings
fallyGrab.Properties.Settings.Default.fbToken = "";
fallyGrab.Properties.Settings.Default.Save();
button5.Visible = true;
label23.Visible = false;
label24.Visible = false;
button6.Visible = false;
}
};
webBrowser.Navigate(logoutUrl.AbsoluteUri);
}