facebook-c#-sdk

facebooksdk.net publish not working - can't get LoginButton.CurrentSession to publish to

时间秒杀一切 提交于 2019-12-02 14:01:43
问题 I've got what seems to be a pretty simple problem - I'm trying to use the facebooksdk.net to publish to a users feed. First, I install with the following command, which gets me Facebook.Client version 0.9.91-alpha: Install-Package Facebook.Client -pre Next, I have a LoginButton (and I'm able to successfully login) <fbc:LoginButton x:Name="_loginButton" SessionStateChanged="_loginButton_SessionStateChanged" Margin="0,15" /> Now, I want to post to the feed, so I use the following code, copied

deserialize dynamic object

梦想与她 提交于 2019-12-02 13:50:04
问题 I am having a lot of trouble trying to figure out how to deserialize my response from making calls to facebook api. my c# code looks like this: FacebookClient client = new FacebookClient(); string path = "SELECT message, type, attachment FROM stream WHERE source_id = " + fbid.ToString(); dynamic result = client.Get("fql", new { q = path }); this is what result looks like - it comes back as json I need to deserialize this Dynamic object , which is a string json into a c# object. don't know

Facebook C# SDK Recommend Post Using Access Token

大城市里の小女人 提交于 2019-12-02 10:23:47
I'm using Facebook C# SDK and i want to recommend posts using offline accesing. And i try this code but it's return The remote server returned an error: (400) Bad Request. var client = new FacebookClient("ACCESS_TOKEN"); dynamic result = client.Post("/POST_ID/likes"); How can i recommend post using access_token ? Thanks for reply.. I just saw another user with the same issue. It might be a bug in the SDK or with the Graph API. As a work around, you can do this. var client = new FacebookClient("ACCESS_TOKEN"); dynamic throwAwayVariable = client.Get("/POST_ID/likes"); dynamic result = client

Application generated apprequests failing in Silverlight

半腔热情 提交于 2019-12-02 09:51:28
I'm trying to send an application-generated request between two users without going through the JavaScript UI. FacebookClient client = new FacebookClient(SessionSecret); Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters["message"] = "Test"; parameters["data"] = "test"; client.PostCompleted += new EventHandler<FacebookApiEventArgs>(testCompleted); client.PostAsync(String.Format("{0}/apprequests", ID), parameters); My testCompleted method FacebookApiEventArgs error is always a null object reference on a stream object that it is expecting: at System.IO

5.0.9 error on Exchange code for access token

我是研究僧i 提交于 2019-12-02 09:04:49
问题 I've followed "Getting Started with an ASP.NET MVC 3 Website" and it has worked fine (5.0.8) until I updated the SDK to 5.0.9. I've got this error when trying to exchange code for access token: Unexpected character encountered while parsing value: a. Line 1, position 1. It occurs at dynamic tokenResult = oAuthClient.ExchangeCodeForAccessToken(code); The "code" is correct as it used to be. Any ideas? Thanks 回答1: I had the same problem, I solved it downloading the source code from CodePlex and

Login using Facebook Problem after logging out

拈花ヽ惹草 提交于 2019-12-02 07:32:06
I am using facebook sdk and facebook connect for integrating fb into my site using asp.net and c#. The user can login using the code successfully. The problem that I face is that whenever a user is logged in thru fb; if the user logs out from the facebook's site and then tries to login through my site using fb connect, it gives error: The session is invalid because the user logged out. I should again provide the facebook connect button to log in as it does initially but it gives error. The code used is shown below: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) {

Facebook C# SDK, AJAX in iFrame app

。_饼干妹妹 提交于 2019-12-02 07:10:40
I am making an iFrame application for Facebook using the Facebook C# SDK. I have it that the user is authenticating and I can get their username using the Graph API (FaceBookApp.Api("/userid")) My problem now is that when I do an AJAX call to a page I can no longer use the Api. The userid is 0. When opening up FireBug the response from the request is "Unsupported get request." I suspect this has something to do with the face that the AJAX request is using a different session for the call and that session is not authenticated. I was wondering if there is any way to get around this? I known I

facebook c# sdk: Add/edit event with newlines in description

倾然丶 夕夏残阳落幕 提交于 2019-12-02 06:21:07
I am trying to edit events on facebook pages. The SDK works fine, but I have one problem. Whenever there are newlines in the description (\r\n), they get posted to facebook. So I get event bodies like: New event!\r\nWelcome to the event. instead of New event! Welcome to the event. looking in the result of a graph get to the event, I see that the newlines are double escaped, and looks like this: ... "name": "TEST EVENT", "description": "New event!\\r\\nWelcome to the event.", "start_time": "2011-03-24T00:00:00" ... I've tried any and all possible solutions I can think of, but to no avail. I've

deserialize dynamic object

随声附和 提交于 2019-12-02 04:57:51
I am having a lot of trouble trying to figure out how to deserialize my response from making calls to facebook api. my c# code looks like this: FacebookClient client = new FacebookClient(); string path = "SELECT message, type, attachment FROM stream WHERE source_id = " + fbid.ToString(); dynamic result = client.Get("fql", new { q = path }); this is what result looks like - it comes back as json I need to deserialize this Dynamic object , which is a string json into a c# object. don't know that it is possible to do a foreach loop on a dynamic object. I also tried to just create an object and

how to make search of a string in a data base in c#

十年热恋 提交于 2019-12-02 04:48:35
This is the code that is used to make the search private void button1_Click(object sender, EventArgs e) { string connectionString = Tyre.Properties.Settings.Default.Database1ConnectionString; SqlConnection conn = new SqlConnection(connectionString); DataTable dt = new DataTable(); SqlDataAdapter SDA = new SqlDataAdapter("SELECT * FROM table1 where Nom like " + textBox1.Text, conn); SDA.Fill(dt); dataGridView1.DataSource = dt; } and im getting this error An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Additional information: Invalid column name