1
我是FaceBook API的新手。我希望從我的aspx網頁上發送消息。我使用了不同的示例並使用FaceBook API 3.1。我收到「服務暫時不可用」錯誤。我已經分配了AppKey,密鑰和會話密鑰。 我的示例代碼如下。ASP.Net和FaceBook Wall整合
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Facebook;
using Facebook.Web;
using Facebook.Rest;
using Facebook.Session;
using Facebook.Utility;
using Facebook.BindingHelper;
using Facebook.Schema;
using Facebook.Web.FbmlControls;
using Facebook.Session.DesktopPopup;
namespace FaceBookApp
{
public partial class _Default : System.Web.UI.Page
{
private const string ApplicationKey = "MY_APP_KEY";
private const string SecretKey = "MY_SECRET_KEY";
private Api fbAPI;
private ConnectSession _connectSession;
// private List<EventUser> _eventUsers;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
_connectSession = new ConnectSession(ApplicationKey, SecretKey);
_connectSession.SessionKey = "MY_SESSION_KEY";
if (!_connectSession.IsConnected())
{
// Not authenticated, proceed as usual.
//lblStatus.Text = "Please sign-in with Facebook.";
}
else
{
// Authenticated, create API instance
fbAPI = new Api(_connectSession);
string response = fbAPI.Stream.Publish("publish steven on facebook.");
}
}
}
}
錯誤消息令人困惑。它必須是一個非常簡單的解決方案。我不知道我錯過了什麼。請幫助。 這裏是facebook例外。 {「服務暫時不可用」}
我也想過這一行。但從2天開始就發生了。你能告訴我在我的程序中是否有任何錯誤?這是一個非常簡單的應用程序。我想我可能會錯過一些東西。 – Jit 2010-03-26 19:56:15
我還沒有在ASP.NET中使用FB API(儘管我已經對其他接口做了一些調整),但是我可以多挖一點,看看代碼中的任何內容是否突出。 – ewall 2010-03-26 21:20:24
不幸的是,我覺得在ASP.NET方面我太綠了,所以我沒有發現太多用處。我假設你已經瀏覽了http://fbtutorial.qsh.eu/上的教程。 – ewall 2010-03-26 21:32:22