facebook-c#-sdk

facebook-C#-sdk MVC “Hello World” app - how to get access token?

拜拜、爱过 提交于 2019-12-20 10:24:13
问题 I've downloaded the C# Facebook SDK "Simple MVC Website Example" from CodePlex at: http://facebooksdk.codeplex.com/releases/view/54371 and have successfully got it to authenticate to my test Facebook app. But I can't quite work out how to get the access token (and I'm going to want offline access, so I only need to grab that token once, when the user first authorizes my app to grab their feed data). Many thanks 回答1: You will want to do two things. First, to request offline_access, you need to

Login using Facebook Problem after logging out

折月煮酒 提交于 2019-12-20 07:05:04
问题 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

ASP.NET4 canvas app: Postback causes unexpected redirect

邮差的信 提交于 2019-12-20 04:38:47
问题 I'm using build 5.06 of the toolkit and I'm just getting started, trying to do something simple: get a postback to work. But when the user clicks the postback button, the browser is redirected to something quickly (I think it's uiserver.???) and then redirected again to facebookredirect.axd, and finally again to my home canvas page. So, the entire session is pretty much reset. I'm hoping there's something obvious that I'm missing (like I should not call authorize on the postback?). Here's my

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

醉酒当歌 提交于 2019-12-20 04:06:25
问题 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":

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

空扰寡人 提交于 2019-12-20 03:52:11
问题 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

Facebook SDK for .NET and Graph API Explorer news feed mismatch

◇◆丶佛笑我妖孽 提交于 2019-12-20 03:19:46
问题 And application is using facebook sdk to get user newsfeed via client.Get(request_string) where request_string = "/me/home<some_filters>" . And I discovered that sdk and api exprorer return different results with the same request string. Why can it happen? 回答1: This is similar to this question. Some posts not visible on the feed through Graph API /me/home The reason is Facebook "scores" nodes to derive the most "Top Story". Low scoring nodes are by default not visible. You can force all nodes

C# equivalent of file_get_contents (PHP)

余生长醉 提交于 2019-12-20 03:10:29
问题 As a follow-up to (OAuthException) (#15) The method you are calling must be called with an app secret signed session I want to know what is the equivalent of file_get_contents(). I tried the following but I got illegal characters in path error. public ActionResult About() { var fb = new FacebookWebClient(FacebookWebContext.Current); var tokenUrl = "https://graph.facebook.com/oauth/access_token?client_id=" + FacebookWebContext.Current.Settings.AppId + "&client_secret=" + FacebookWebContext

Logging out from facebook using facebook c# sdk in WP7

大城市里の小女人 提交于 2019-12-19 11:05:55
问题 I want to implement logout from facebook using facebook C# sdk in my windows phone app My primary question is how do we logout using Facebook C# SDK in WP7 I found this article in search Article link there he is trying to find the logout url using regex, but that did not working in my app when i try that the browser navigated event is going into infinite loop you can share any samples/posts related to facebook logout in windows phone 7. I want logout should happen with out user intervention,

Facebook C# SDK Sample code

南楼画角 提交于 2019-12-19 04:23:32
问题 I am using Facebook C# SDk 4.1.1 to develop an application. Is there anyone has a complete sample code for asp.net forms including web config settings? I am really tired making the sample code to work. I believe I am using the correct settings in both facebook app registration and web.Config file The issue is: When I run my test project from Visual studio it is taking to facebook log in page. After I log in, the app is requesting to authorize it. Once I click on allow button, the brwoser is

C#: Anything wrong with setting HttpContext.Current in a parallel thread?

纵饮孤独 提交于 2019-12-19 03:07:42
问题 I'm using a library that relies on HttpContext.Current. The library is Facebook C# SDK, but my question should apply in other scenarios as well. I'd like to use this library from inside of a parallel thread. However, HttpContext.Current is not available in the parallel thread, so I'm thinking about caching it to a local variable and then setting it in the parallel thread like this: var httpContext = HttpContext.Current; Parallel.ForEach(items, item => { try { HttpContext.Current = httpContext