我是Web处理程序的新手。这是基本上从www.facebooksdk.net教程中获取的处理程序。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace PogoTrip
{
/// <summary>
/// Summary description for FacebookLogin1
/// </summary>
public class FacebookLogin : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
var accessToken = context.Request["accessToken"];
context.Session["AccessToken"] = accessToken;
context.Response.Redirect("~/Default.aspx");
}
public bool IsReusable
{
get { return false; }
}
}
}
然后这是我用来尝试检索令牌的代码:
protected void Page_Load(object sender, EventArgs e)
{
var accessToken = Session["AccessToken"].ToString();
var client = new Facebook.FacebookClient(accessToken);
dynamic me = client.Get("me", new { fields = "name,id" });
}
我无法弄清楚如何实际引用.ashx文件(我认为这是问题无论如何
谢谢!